@aikdna/kdna-cli 0.19.1 → 0.19.2
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/package.json +1 -1
- package/src/cli.js +1 -1
- package/src/publish.js +9 -3
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -203,7 +203,7 @@ switch (cmd) {
|
|
|
203
203
|
let output = null;
|
|
204
204
|
let target = null;
|
|
205
205
|
for (let i = 2; i < args.length; i++) {
|
|
206
|
-
if (args[i] === '--output' || args[i] === '-o') {
|
|
206
|
+
if (args[i] === '--output' || args[i] === '--out' || args[i] === '-o') {
|
|
207
207
|
output = args[i + 1];
|
|
208
208
|
i++;
|
|
209
209
|
} else if (args[i].startsWith('-')) {
|
package/src/publish.js
CHANGED
|
@@ -697,6 +697,14 @@ function sha256File(p) {
|
|
|
697
697
|
return crypto.createHash('sha256').update(fs.readFileSync(p)).digest('hex');
|
|
698
698
|
}
|
|
699
699
|
|
|
700
|
+
function outputDirFromArgs(args, fallback) {
|
|
701
|
+
for (const flag of ['--output', '--out', '-o']) {
|
|
702
|
+
const idx = args.indexOf(flag);
|
|
703
|
+
if (idx >= 0) return args[idx + 1];
|
|
704
|
+
}
|
|
705
|
+
return fallback;
|
|
706
|
+
}
|
|
707
|
+
|
|
700
708
|
/**
|
|
701
709
|
* kdna publish <path> — Full publish pipeline.
|
|
702
710
|
*
|
|
@@ -781,9 +789,7 @@ function cmdPublish(domainPath, args = []) {
|
|
|
781
789
|
|
|
782
790
|
// 3. Pack
|
|
783
791
|
const fileName = `${m[2]}-${manifest.version}.kdna`;
|
|
784
|
-
const outDir = args.
|
|
785
|
-
? args[args.indexOf('--output') + 1]
|
|
786
|
-
: path.join(abs, 'dist');
|
|
792
|
+
const outDir = outputDirFromArgs(args, path.join(abs, 'dist'));
|
|
787
793
|
fs.mkdirSync(outDir, { recursive: true });
|
|
788
794
|
const outPath = path.join(outDir, fileName);
|
|
789
795
|
packToFile(abs, outPath);
|