ppackage 2.5.0 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +9 -4
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -219,7 +219,10 @@ class ppackage {
219
219
  }
220
220
 
221
221
 
222
- async gitify() {
222
+ async gitify(branch = null) {
223
+
224
+ if(!branch)
225
+ branch = args.shift() || "master";
223
226
 
224
227
  if(fs.existsSync(GIT_FOLDER))
225
228
  throw `Cowardly aborting working with existing git project`;
@@ -231,12 +234,14 @@ class ppackage {
231
234
  await passthru("git", ["clone", ...cloneopts, repository_url, GIT_FOLDER]);
232
235
 
233
236
  await passthru("git", ["config", "--unset", "core.bare"]);
234
- await passthru("git", ["reset", "HEAD", "--", "."]);
237
+ await passthru("git", ["reset", branch]);
238
+ await passthru("git", ["checkout", branch]);
235
239
 
236
- for(let line of [GITIGNORE_PATH, DOCKERIGNORE_PATH, NPMIGNORE_PATH, NPMRC_PATH])
240
+ for(let line of [GITIGNORE_PATH, DOCKERIGNORE_PATH, NPMIGNORE_PATH])
237
241
  await passthru("git", ["checkout", "--", line]).catch(()=>{});
238
242
 
239
- let restore = [];
243
+
244
+ let restore = [".git*", NPMRC_PATH];
240
245
  if(fs.existsSync(DOCKERIGNORE_PATH)) {
241
246
  let ignore = fs.readFileSync(DOCKERIGNORE_PATH, 'utf8');
242
247
  restore.push(...ignore.split("\n"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ppackage",
3
- "version": "2.5.0",
3
+ "version": "2.6.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {