Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

move list to ls

  • Loading branch information...
commit e9c55c8d09ed1b13437cf717cbab295c32ac0bdc 1 parent 9c4dbc6
@leonchen authored
View
18 bin/gitfs
@@ -2,15 +2,15 @@
//samples:
-//
-//DEBUG=true gitfs sha (HEAD|<branch>|<tag>)
-//
-//gitfs list <sha> .
-//gitfs list <sha> dir
-//
-//gitfs read <sha> file
-//gitfs read <sha> dir/file
-//gitfs read <sha> dir/**/*.xml
+// 1. get sha
+// DEBUG=true gitfs sha (HEAD|<branch>|<tag>)
+// 2. list tree
+// gitfs ls <sha> .
+// gitfs ls <sha> dir
+// 3. read blob
+// gitfs read <sha> file
+// gitfs read <sha> dir/file
+// gitfs read <sha> dir/**/*.xml
var exec = require('child_process').exec
View
10 example/ls.js
@@ -11,27 +11,27 @@ var show = function () {
if (debug) console.log.apply(console, arguments);
};
-gf.list('HEAD', '', function (err, tree) {
+gf.ls('HEAD', '', function (err, tree) {
if (err) return show(err);
show('<empty>', tree.map(function (t) { return t[3]; }));
});
-gf.list('HEAD', 'packages/poi.us', function (err, tree) {
+gf.ls('HEAD', 'packages/poi.us', function (err, tree) {
if (err) return show(err);
show('packages/poi.us', tree.map(function (t) { return t[3]; }));
});
-gf.list('HEAD', 'packages/poi.us/', function (err, tree) {
+gf.ls('HEAD', 'packages/poi.us/', function (err, tree) {
if (err) return show(err);
show('packages/poi.us/', tree.map(function (t) { return t[3]; }));
});
-gf.list('HEAD', 'packages/poi.us/*.js', function (err, tree) {
+gf.ls('HEAD', 'packages/poi.us/*.js', function (err, tree) {
if (err) return show(err);
show('packages/poi.us/*.js', tree.map(function (t) { return t[3]; }));
});
-gf.list('HEAD', 'packages/poi.us/Address.js', function (err, tree) {
+gf.ls('HEAD', 'packages/poi.us/Address.js', function (err, tree) {
if (err) return show(err);
show('packages/poi.us/Address.js', tree.map(function (t) { return t[3]; }));
});
View
2  example/ref.js
@@ -15,7 +15,7 @@ var show = function () {
gf.sha('HEAD', function (err, sha) {
if (err) return show(err);
show('HEAD', sha);
- gf.list(sha, 'packages', function (err, tree) {
+ gf.ls(sha, 'packages', function (err, tree) {
if (err) return show(err);
show('packages', tree.map(function (t) { return t[3]; }));
});
View
6 lib/gitFileSystem.ms
@@ -45,18 +45,18 @@ export class GitFileSystem {
});
};
- function list(sha, target, type, cb) {
+ function ls(sha, target, type, cb) {
if (type instanceof Function) {
cb = type;
type = null;
}
- this.debugLog("list - sha:"+sha+", target:"+target+" type:"+type);
+ this.debugLog("ls - sha:"+sha+", target:"+target+" type:"+type);
this.getType(sha, type, function (err, type) {
if (err) return cb(err);
if (type == 'tag') {
self.getTagCommit(sha, function (error, commitSHA) {
if (error) return cb(error);
- self.list(commitSHA, target, 'commit', cb);
+ self.ls(commitSHA, target, 'commit', cb);
});
} else if (type == 'commit') {
self.getCommitTree(sha, function (error, treeSHA) {
View
2  package.json
@@ -1,7 +1,7 @@
{
"name": "gitfs",
"description": "git data fetcher",
- "version": "0.0.2",
+ "version": "0.0.3",
"private": false,
"licenses": [ { "type": "MIT" }],
"author": "Leon Chen",
Please sign in to comment.
Something went wrong with that request. Please try again.