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.
- package/index.js +9 -4
- 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",
|
|
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
|
|
240
|
+
for(let line of [GITIGNORE_PATH, DOCKERIGNORE_PATH, NPMIGNORE_PATH])
|
|
237
241
|
await passthru("git", ["checkout", "--", line]).catch(()=>{});
|
|
238
242
|
|
|
239
|
-
|
|
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"));
|