@symbo.ls/cli 2.11.326 → 2.11.328

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 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 ${cloneUrl} ${dest}` + options.remote ? ' -b feature/remote' : '')
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
- execSync('yarn')
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.readFile(filePath, 'utf8', (err, data) => {
8
- if (err) {
9
- console.error('Error reading file:', err)
10
- return
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
- try {
14
- const jsonData = JSON.parse(data)
13
+ try {
14
+ const jsonData = JSON.parse(data)
15
15
 
16
- jsonData[key] = value
16
+ jsonData[key] = value
17
17
 
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
- }
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.326",
3
+ "version": "2.11.328",
4
4
  "description": "Fetch your Symbols configuration",
5
5
  "main": "bin/fetch.js",
6
6
  "author": "Symbols",
@@ -20,12 +20,14 @@
20
20
  "@symbo.ls/socket": "latest",
21
21
  "chalk": "^5.0.0",
22
22
  "commander": "latest",
23
+ "diff": "^5.2.0",
23
24
  "esbuild": "^0.19.2",
25
+ "inquirer": "^9.2.17",
24
26
  "node-fetch": "^3.1.0",
25
27
  "v8-compile-cache": "^2.3.0"
26
28
  },
27
29
  "peerDependencies": {
28
30
  "@symbo.ls/convert": "latest"
29
31
  },
30
- "gitHead": "28be545ac40009d8911581033803863471a1b05a"
32
+ "gitHead": "2fe729a3a00c5badf8ef0b56d67af1aa041f56d9"
31
33
  }