ppackage 2.4.3 → 2.5.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 +11 -5
- package/package.json +3 -4
- package/bin/ddev +0 -1
- package/bin/ppackage +0 -1
package/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
1
2
|
"use strict";
|
|
2
3
|
|
|
3
4
|
const fs = require('fs');
|
|
@@ -5,7 +6,8 @@ const path = require('path');
|
|
|
5
6
|
const semver = require('semver');
|
|
6
7
|
const {spawn} = require('child_process');
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
|
|
10
|
+
const {args} = require('nyks/process/parseArgs')();
|
|
9
11
|
const passthru = require('nyks/child_process/passthru');
|
|
10
12
|
const wait = require('nyks/child_process/wait');
|
|
11
13
|
const trim = require('mout/string/trim');
|
|
@@ -149,7 +151,7 @@ class ppackage {
|
|
|
149
151
|
if(line.repository) current_repository = line.repository;
|
|
150
152
|
}
|
|
151
153
|
|
|
152
|
-
let target_repository = repository || args.
|
|
154
|
+
let target_repository = repository || args.shift() || current_repository;
|
|
153
155
|
|
|
154
156
|
if(!target_repository)
|
|
155
157
|
throw `Invalid repository url`;
|
|
@@ -166,7 +168,6 @@ class ppackage {
|
|
|
166
168
|
}
|
|
167
169
|
|
|
168
170
|
async version(version = false, notag = false) {
|
|
169
|
-
|
|
170
171
|
let repositories = [];
|
|
171
172
|
|
|
172
173
|
let current_version;
|
|
@@ -180,7 +181,7 @@ class ppackage {
|
|
|
180
181
|
throw `Inconsitant repository ${unique(repositories).join(',')} detected, use ppackage repository first`;
|
|
181
182
|
|
|
182
183
|
|
|
183
|
-
let target_version = version || args.
|
|
184
|
+
let target_version = version || args.shift();
|
|
184
185
|
|
|
185
186
|
let dirty = await wait(spawn('git', ["diff-index", "--quiet", "HEAD"])).catch(() => true);
|
|
186
187
|
if(dirty && !notag)
|
|
@@ -275,9 +276,14 @@ class ppackage {
|
|
|
275
276
|
return {repository_url};
|
|
276
277
|
}
|
|
277
278
|
|
|
278
|
-
|
|
279
279
|
}
|
|
280
280
|
|
|
281
281
|
|
|
282
|
+
//ensure module is called directly, i.e. not required
|
|
283
|
+
if(module.parent === null) {
|
|
284
|
+
let cmd = args.shift();
|
|
285
|
+
require('cnyks/lib/bundle')(ppackage, null, [`--ir://run=${cmd}`]); //start runner
|
|
286
|
+
}
|
|
287
|
+
|
|
282
288
|
module.exports = ppackage;
|
|
283
289
|
|
package/package.json
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ppackage",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
7
|
-
"ppackage": "
|
|
8
|
-
"ddev": "./bin/ddev",
|
|
7
|
+
"ppackage": "index.js",
|
|
9
8
|
"askpass": "./bin/askpass"
|
|
10
9
|
},
|
|
11
10
|
"dependencies": {
|
|
12
|
-
"cnyks": "^3.1
|
|
11
|
+
"cnyks": "^3.2.1",
|
|
13
12
|
"mout": "^1.0.0",
|
|
14
13
|
"nyks": "^6.1.8",
|
|
15
14
|
"semver": "^5.3.0",
|
package/bin/ddev
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
cnyks ddev --ir://run=$*
|
package/bin/ppackage
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
cnyks ppackage --ir://run=$*
|