@symbo.ls/cli 2.11.326 → 2.11.327
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/bin/create.js +3 -3
- package/bin/init-helpers/addToJson.js +17 -18
- package/package.json +3 -2
package/bin/create.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import chalk from 'chalk'
|
|
4
4
|
import fs from 'fs'
|
|
5
5
|
import path from 'path'
|
|
6
|
-
import { execSync } from 'child_process'
|
|
6
|
+
import { execSync, spawnSync } from 'child_process'
|
|
7
7
|
import { program } from './program.js'
|
|
8
8
|
import { addToJson } from './init-helpers/addToJson.js'
|
|
9
9
|
|
|
@@ -55,7 +55,7 @@ program
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
console.log(`Cloning ${cloneUrl} into '${dest}'...`)
|
|
58
|
-
execSync(`git clone ${
|
|
58
|
+
execSync(`git clone ${options.remote ? ' -b feature/remote' : ''} ${cloneUrl} ${dest}`)
|
|
59
59
|
|
|
60
60
|
process.chdir(dest)
|
|
61
61
|
|
|
@@ -65,7 +65,7 @@ program
|
|
|
65
65
|
|
|
66
66
|
console.log('Installing Dependencies...')
|
|
67
67
|
console.log()
|
|
68
|
-
|
|
68
|
+
spawnSync('yarn')
|
|
69
69
|
console.log()
|
|
70
70
|
console.log(chalk.green.bold(dest), 'successfuly created!')
|
|
71
71
|
console.log(`Done! run \`${chalk.bold('npm start')}\` to start the development server.`)
|
|
@@ -4,25 +4,24 @@ import fs from 'fs'
|
|
|
4
4
|
|
|
5
5
|
// Step 1: Read the JSON file
|
|
6
6
|
export const addToJson = (filePath, key, value) => {
|
|
7
|
-
fs.
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
const data = fs.readFileSync(filePath, { encoding: 'utf8' })
|
|
8
|
+
if (!data) {
|
|
9
|
+
console.error('Error reading file:', data)
|
|
10
|
+
return
|
|
11
|
+
}
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
try {
|
|
14
|
+
const jsonData = JSON.parse(data)
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
jsonData[key] = value
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
})
|
|
18
|
+
fs.writeFileSync(filePath, JSON.stringify(jsonData, null, 2), 'utf8', err => {
|
|
19
|
+
if (err) {
|
|
20
|
+
console.error('Error writing file:', err)
|
|
21
|
+
}
|
|
22
|
+
console.log(filePath, JSON.stringify(jsonData, null, 2))
|
|
23
|
+
})
|
|
24
|
+
} catch (parseError) {
|
|
25
|
+
console.error('Error parsing JSON:', parseError)
|
|
26
|
+
}
|
|
28
27
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbo.ls/cli",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.327",
|
|
4
4
|
"description": "Fetch your Symbols configuration",
|
|
5
5
|
"main": "bin/fetch.js",
|
|
6
6
|
"author": "Symbols",
|
|
@@ -21,11 +21,12 @@
|
|
|
21
21
|
"chalk": "^5.0.0",
|
|
22
22
|
"commander": "latest",
|
|
23
23
|
"esbuild": "^0.19.2",
|
|
24
|
+
"inquirer": "^9.2.17",
|
|
24
25
|
"node-fetch": "^3.1.0",
|
|
25
26
|
"v8-compile-cache": "^2.3.0"
|
|
26
27
|
},
|
|
27
28
|
"peerDependencies": {
|
|
28
29
|
"@symbo.ls/convert": "latest"
|
|
29
30
|
},
|
|
30
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "cad8a2eaaaa68b40c237cc35d1236095f600a30e"
|
|
31
32
|
}
|