Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

girror

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

girror - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

32

lib/girror.js

@@ -0,1 +1,2 @@

var fs = require('fs');
var path = require('path');

@@ -25,2 +26,3 @@ var util = require('util');

* Pass any custom function to implement your own remote fetch mapper.
* `options.girrorfile`: if `true` a '.girror.json' file will be created at the root of the worktree with metadata on the girror operation.
*/

@@ -38,2 +40,3 @@ function girror(remote, worktree, options, callback) {

var branch = options.branch || null;
var girrorfile = 'girrorfile' in options ? options.girrorfile : '.girror.json';

@@ -86,2 +89,5 @@ if (!remote) throw new Error('`remote` url is required');

// create girrorfile
$girrorfile(worktree, girrorfile),
], callback);

@@ -100,3 +106,3 @@ }

return cb();
}
};
}

@@ -116,3 +122,3 @@

return git(args, opts, cb);
}
};
}

@@ -126,6 +132,26 @@

return mkdirp(dir, cb);
}
};
}
/**
* Promise to create a girror file in `file`
*/
function $girrorfile(worktree, file) {
return function(cb) {
if (!file) return cb(); // no girror file
logger.info('creating: ' + path.join(worktree, file));
var contents = {
remote: remote,
branch: branch,
updated: new Date(),
};
return fs.writeFile(path.join(worktree, file), JSON.stringify(contents, true, 2), cb);
};
}
/**
* Returns the system's temp directory

@@ -132,0 +158,0 @@ */

2

package.json

@@ -5,3 +5,3 @@ {

"description": "Efficient mirror of git repositories. Great for continuous deployment",
"version": "0.1.0",
"version": "0.1.1",
"repository": {

@@ -8,0 +8,0 @@ "type": "git",

@@ -57,2 +57,3 @@ # girror - Efficient mirroring of git remotes #

SSH URL (e.g. `git@github.com/account/repo.git`)
* `options.girrorfile` - The name of the girror file to create under the worktree (contains some metadata on the last girror operation). Set to `false` to disable. Default is `.girror.json`.

@@ -59,0 +60,0 @@ ### girror.git(args, options, callback) ###

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc