Giter Club home page Giter Club logo

lebje / lfspointers Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 21.95 MB

A Swift library and CLI that allows you to convert a Git repository directory of large files to Git LFS pointers.

Home Page: https://lebje.github.io/LFSPointers

License: MIT License

Swift 84.92% Shell 5.75% Dockerfile 1.20% Ruby 0.12% Roff 8.01%
cli command-line-tool executable git-lfs gitlfs json lfs-pointers linux macos macosx spm swift swift-library swift-package swift-package-manager swift5 windows windows-10 windows10

lfspointers's People

Contributors

lebje avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

lfspointers's Issues

Replace Print Statements with Progress Closures

Functions such as

public static func pointers(forDirectory directory: String,
								searchType type: SearchTypes,
								recursive: Bool = false,
								printOutput: Bool = false,
								printVerboseOutput: Bool = false) throws -> [(filename: String, filePath: String, pointer: LFSPointer)]

, and

public func write(toFile file: String, shouldAppend: Bool = false, printOutput: Bool = false, printVerboseOutput: Bool = false) throws

, take the parameters printOutput: Bool = false, printVerboseOutput: Bool = false . This creates code like this (taken from LFSPointer.pointer(...)):

if printOutput && printVerboseOutput {
	print("Converting \"\(file.name)\" to pointer...\n")
	print("git lfs pointer --file=\(file.name)".blue)
} else if printOutput {
	print("Converting \"\(file.name)\" to pointer...\n")
}

.
Let’s instead use code like this:

public func write(toFile file: String, shouldAppend: Bool = false, progressClosure: (File, RunStatus) -> Void) throws {

	let file = try File(path: file)
	
	...
	
	progressClosure(file, .writing)
	...
}

// Generate pointer.
let pointer = LFSPointer.pointer(...)

pointer.write(toFile: "/full/path/to/foo.txt") { file, status in
	switch status {
		case .writing:
			print("Overwriting file \"\(file.name)\" with pointer...")
	}
}

Todo:

  • Write code.
  • Verify tests passed.
  • Update README to reflect change.
  • Merge code with master branch.
  • Update Homebrew formulae to reflect latest tag.

Add Makefile

This Makefile will:

  • Update the git tag in homebrew-formulae and LFSPointersExecutable.
  • Allow users to run make install, to install this program.

Add Sample Projects

iOS Project:

  • Display a pointer for one of two files the user will be able to choose from.

MacOS Project:

  • Allow the user to select a file, then show the user a pointer for that file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.