@techninja/clearstack 0.3.29 → 0.3.32
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/lib/update.js +10 -1
- package/package.json +1 -1
package/lib/update.js
CHANGED
|
@@ -14,7 +14,7 @@ import { detectPlatforms, updatePlatform } from './platform.js';
|
|
|
14
14
|
* @param {string} src
|
|
15
15
|
* @param {string} dest
|
|
16
16
|
* @param {string} label
|
|
17
|
-
* @param {{ skipExisting?: boolean }} [opts]
|
|
17
|
+
* @param {{ skipExisting?: boolean, onlyExisting?: boolean }} [opts]
|
|
18
18
|
* @returns {number} count of updated files
|
|
19
19
|
*/
|
|
20
20
|
function syncDir(src, dest, label, opts = {}) {
|
|
@@ -25,6 +25,7 @@ function syncDir(src, dest, label, opts = {}) {
|
|
|
25
25
|
|
|
26
26
|
for (const file of files) {
|
|
27
27
|
const destPath = join(dest, file);
|
|
28
|
+
if (opts.onlyExisting && !existsSync(destPath)) continue;
|
|
28
29
|
if (opts.skipExisting && existsSync(destPath)) {
|
|
29
30
|
console.log(` ⏭ Skipped: ${label}/${file} (exists, use --force to overwrite)`);
|
|
30
31
|
continue;
|
|
@@ -82,6 +83,14 @@ export async function update(pkgRoot, opts = {}) {
|
|
|
82
83
|
}
|
|
83
84
|
}
|
|
84
85
|
|
|
86
|
+
// Scripts: sync clearstack-owned scripts (only update existing files)
|
|
87
|
+
total += syncDir(
|
|
88
|
+
resolve(templateShared, 'scripts'),
|
|
89
|
+
resolve(process.cwd(), 'scripts'),
|
|
90
|
+
'scripts',
|
|
91
|
+
{ onlyExisting: true },
|
|
92
|
+
);
|
|
93
|
+
|
|
85
94
|
// Write spec version marker
|
|
86
95
|
const pkg = JSON.parse(readFileSync(resolve(pkgRoot, 'package.json'), 'utf-8'));
|
|
87
96
|
const versionPath = resolve(process.cwd(), 'docs/clearstack/.specversion');
|
package/package.json
CHANGED