fg-devkit 1.7.12 → 1.7.14
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
CHANGED
|
@@ -27,7 +27,7 @@ function runNcu(args = []) {
|
|
|
27
27
|
const effectiveArgs =
|
|
28
28
|
args.length > 0
|
|
29
29
|
? args
|
|
30
|
-
: ['--interactive', '--format', 'group', '--upgrade', '--packageManager', 'pnpm', '--install', '
|
|
30
|
+
: ['--interactive', '--format', 'group', '--upgrade', '--packageManager', 'pnpm', '--install', 'always']
|
|
31
31
|
|
|
32
32
|
const result = spawnSync(process.execPath, [ncuBin, ...effectiveArgs], {
|
|
33
33
|
stdio: 'inherit',
|
|
@@ -54,6 +54,12 @@ function runGit(args) {
|
|
|
54
54
|
return result.status ?? 1
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
function stageExistingFiles(files) {
|
|
58
|
+
const existingFiles = files.filter((filePath) => fs.existsSync(path.join(process.cwd(), filePath)))
|
|
59
|
+
if (existingFiles.length === 0) return 0
|
|
60
|
+
return runGit(['add', '--', ...existingFiles])
|
|
61
|
+
}
|
|
62
|
+
|
|
57
63
|
function readJson(jsonPath) {
|
|
58
64
|
return JSON.parse(fs.readFileSync(jsonPath, 'utf8'))
|
|
59
65
|
}
|
|
@@ -123,7 +129,7 @@ function main() {
|
|
|
123
129
|
}
|
|
124
130
|
|
|
125
131
|
const [only] = changed
|
|
126
|
-
const stageExitCode =
|
|
132
|
+
const stageExitCode = stageExistingFiles(['package.json', 'pnpm-lock.yaml'])
|
|
127
133
|
if (stageExitCode !== 0) {
|
|
128
134
|
process.exit(stageExitCode)
|
|
129
135
|
}
|