@cerema/cadriciel 1.4.38 → 1.4.39

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.
@@ -15,13 +15,6 @@ module.exports = (args) => {
15
15
  });
16
16
  });
17
17
  };
18
-
19
- const extractLiquibaseVersion = (output) => {
20
- const versionLine = output
21
- .split('\n')
22
- .find((line) => line.startsWith('Liquibase Version:'));
23
- return versionLine ? versionLine.trim() : 'Version not found';
24
- };
25
18
  return {
26
19
  info: {
27
20
  title: 'doctor',
@@ -29,27 +22,29 @@ module.exports = (args) => {
29
22
  },
30
23
  start: () => {
31
24
  console.log(' ');
25
+
32
26
  console.log(' 🏥 ' + chalk.bold('Pré-requis globaux'));
33
27
  console.log(' ');
34
28
  const myTasks = [
35
29
  {
36
30
  title: 'Homebrew',
37
- task: () => checkInstallation('brew --version'),
31
+ task: () => checkInstallation('brew --version'),
38
32
  },
39
33
  {
40
34
  title: 'Pnpm',
41
- task: () => checkInstallation('pnpm -v'),
35
+ task: () => checkInstallation('pnpm -v'),
42
36
  },
43
37
  {
44
38
  title: 'Git',
45
- task: () => checkInstallation('git --version'),
39
+ task: () => checkInstallation('git --version'),
46
40
  },
47
41
  {
48
42
  title: 'Java',
49
- task: () => checkInstallation('java --version'),
43
+ task: () => checkInstallation('java --version'),
50
44
  },
51
45
  ];
52
46
  if (platform === 'linux ') myTasks.splice(0, 1);
47
+ if (platform === 'win32') myTasks.splice(0, 1);
53
48
 
54
49
  const tasks = new Listr(myTasks, {
55
50
  concurrent: true,
@@ -60,11 +55,11 @@ module.exports = (args) => {
60
55
  [
61
56
  {
62
57
  title: 'Docker',
63
- task: () => checkInstallation('docker ps'),
58
+ task: () => checkInstallation('docker ps'),
64
59
  },
65
60
  {
66
61
  title: 'Docker Compose',
67
- task: () => checkInstallation('docker-compose --version'),
62
+ task: () => checkInstallation('docker-compose --version'),
68
63
  },
69
64
  ],
70
65
  { concurrent: true, exitOnError: false }
@@ -80,9 +75,20 @@ module.exports = (args) => {
80
75
  ' (si vous utilisez docker)'
81
76
  );
82
77
  console.log(' ');
83
- dockerTasks.run().catch((err) => {});
78
+ dockerTasks.run().then(()=>{
79
+ }).catch((err) => {});
84
80
  })
85
- .catch((err) => {});
81
+ .catch((err) => {
82
+ console.log(' ');
83
+ console.log(
84
+ ' 📦 ' +
85
+ chalk.bold('Pré-requis Docker') +
86
+ ' (si vous utilisez docker)'
87
+ );
88
+ console.log(' ');
89
+ dockerTasks.run().then(()=>{
90
+ }).catch((err) => {});
91
+ });
86
92
  },
87
93
  };
88
94
  };
@@ -61,12 +61,17 @@ Host cadriciel
61
61
  try {
62
62
  fs.mkdirSync(userHome + '/.ssh');
63
63
  } catch (e) {}
64
+ try {
64
65
  var ssh = fs.readFileSync(userHome + '/.ssh/config', 'utf-8');
65
- if (!ssh.includes('87c7dfbf-172a-4084-a862-4a23f35a5b79 ')) {
66
- ssh += '\n\n' + sshtemplate;
67
- fs.writeFileSync(userHome + '/.ssh/config', ssh, { flag: 'a' });
68
- fs.chmodSync(userHome + '/.ssh/config', 0o600);
69
- }
66
+ } catch(e) {
67
+ var ssh='';
68
+
69
+ }
70
+ if (!ssh.includes('87c7dfbf-172a-4084-a862-4a23f35a5b79 ')) {
71
+ ssh += '\n\n' + sshtemplate;
72
+ fs.writeFileSync(userHome + '/.ssh/config', ssh, { flag: 'a' });
73
+ fs.chmodSync(userHome + '/.ssh/config', 0o600);
74
+ }
70
75
  } catch (e) {
71
76
  console.log(e);
72
77
  error(
@@ -10,6 +10,11 @@ module.exports = (args) => {
10
10
  const userHome = require('os').homedir();
11
11
  const { error } = require(path.join('..', '..', 'lib', 'message'));
12
12
  const { getTemplates } = require(path.join('..', '..', 'lib', 'util'));
13
+
14
+ const CadricielAPI = require(path.join('..', '..', 'lib', 'cadriciel'));
15
+ const cadriciel = new CadricielAPI();
16
+ var templates = [];
17
+
13
18
  const link = (url, name) => {
14
19
  if (!name) name = url;
15
20
  if (url.includes('localhost')) url = 'http://' + url + '/';
@@ -31,12 +36,17 @@ module.exports = (args) => {
31
36
  try {
32
37
  fs.mkdirSync(userHome + '/.ssh');
33
38
  } catch (e) {}
39
+ try {
34
40
  var ssh = fs.readFileSync(userHome + '/.ssh/config', 'utf-8');
35
- if (!ssh.includes('87c7dfbf-172a-4084-a862-4a23f35a5b79 ')) {
36
- ssh += '\n\n' + sshtemplate;
37
- fs.writeFileSync(userHome + '/.ssh/config', ssh, { flag: 'a' });
38
- fs.chmodSync(userHome + '/.ssh/config', 0o600);
39
- }
41
+ } catch(e) {
42
+ var ssh='';
43
+
44
+ }
45
+ if (!ssh.includes('87c7dfbf-172a-4084-a862-4a23f35a5b79 ')) {
46
+ ssh += '\n\n' + sshtemplate;
47
+ fs.writeFileSync(userHome + '/.ssh/config', ssh, { flag: 'a' });
48
+ fs.chmodSync(userHome + '/.ssh/config', 0o600);
49
+ }
40
50
  } catch (e) {
41
51
  console.log(e);
42
52
  error(
@@ -53,9 +63,7 @@ Host cadriciel
53
63
  IdentitiesOnly yes
54
64
  # -----------------------------------------------------
55
65
  `;
56
- const CadricielAPI = require(path.join('..', '..', 'lib', 'cadriciel'));
57
- const cadriciel = new CadricielAPI();
58
- var templates = [];
66
+
59
67
 
60
68
  /** loading the project */
61
69
  const load = async (uri, title) => {
@@ -77,11 +77,18 @@ module.exports = (args) => {
77
77
  description: 'upgrade cadriciel framework',
78
78
  },
79
79
  start: () => {
80
+ console.log(' ');
80
81
  var spinner = ora('📥 Téléchargement du patch...').start();
81
82
  try {
82
- var info = require(`${process.cwd()}/.cadriciel/version.json`);
83
+ var info = require(path.join(process.cwd(),'.cadriciel','version.json'));
83
84
  } catch (e) {
84
- var info = require(`${process.cwd()}/.cadriciel/bin/version.json`);
85
+ try {
86
+ var info = require(path.join(process.cwd(),'.cadriciel','bin','version.json'));
87
+ } catch (e) {
88
+ spinner.fail('upgrade doit être lancé à partir de votre projet.');
89
+ console.log(' ');
90
+ return;
91
+ }
85
92
  }
86
93
  const title = 'cadriciel-' + info.name;
87
94
  download(title, async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cerema/cadriciel",
3
- "version": "1.4.38",
3
+ "version": "1.4.39",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "npm": ">=8.0.0",