@newlogic-digital/cli 0.0.15 → 0.0.17

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newlogic-digital/cli",
3
- "version": "0.0.15",
3
+ "version": "0.0.17",
4
4
  "main": "index.mjs",
5
5
  "bin": {
6
6
  "newlogic-cli": "index.mjs",
@@ -87,6 +87,7 @@ export default async function cms(name, { variant, branch }) {
87
87
  await move('docker-compose.yml')
88
88
  await move('phpstan.neon')
89
89
  await move('pint.json')
90
+ await move('rector.php')
90
91
  await fse.move(join(tempDir, '.gitlab-ci.prod.yml'), resolve(process.cwd(), '.gitlab-ci.yml'), { overwrite: true }).catch(err => console.log(`${pc.red(err)} - .gitlab-ci.yml`))
91
92
 
92
93
  fse.removeSync(tempDir)
@@ -1,9 +1,41 @@
1
1
  import { execSync } from '../../utils.mjs'
2
+ import fse from 'fs-extra'
2
3
  import prompts from 'prompts'
4
+ import { join, resolve } from 'path'
3
5
 
4
6
  export default async function ui(name, { branch }) {
5
7
  execSync(`git clone -b ${branch} --single-branch --depth 1 git@git.newlogic.cz:newlogic-dev/newlogic-ui.git ${name || '.'}`)
6
8
 
9
+ const gitPath = name ? join(resolve(process.cwd(), name), '.git') : resolve(process.cwd(), '.git')
10
+
11
+ fse.removeSync(gitPath)
12
+
13
+ const { git } = await prompts([
14
+ {
15
+ type: 'select',
16
+ name: 'git',
17
+ message: 'Init as git repository?',
18
+ choices: [
19
+ { title: 'yes', value: 'yes' },
20
+ { title: 'no', value: 'no' }
21
+ ]
22
+ }
23
+ ])
24
+
25
+ if (git === 'yes') {
26
+ execSync(`git init ${name || ''}`)
27
+
28
+ const { remote } = await prompts([
29
+ {
30
+ type: 'text',
31
+ name: 'remote',
32
+ message: 'Set remote for git repository'
33
+ }
34
+ ])
35
+
36
+ execSync(`cd ${name || '.'} && git remote add origin ${remote} ${name ? '&& cd ..' : ''}`)
37
+ }
38
+
7
39
  const { install } = await prompts([
8
40
  {
9
41
  type: 'select',