@cerema/cadriciel 0.5.5 → 0.5.7
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/cli.js +0 -1
- package/cmd/init.js +10 -0
- package/lib/s3.js +0 -1
- package/lib/util.js +5 -0
- package/package.json +1 -1
- package/cmd_available/start.js +0 -15
- package/cmd_available/stop.js +0 -16
package/cli.js
CHANGED
package/cmd/init.js
CHANGED
|
@@ -41,6 +41,7 @@ module.exports = function (program) {
|
|
|
41
41
|
var text = fs.readFileSync(input, 'utf-8');
|
|
42
42
|
text = text.replace(/§§project§§/g, o.project);
|
|
43
43
|
text = text.replace(/§§projectUpper§§/g, o.project.toUpperCase());
|
|
44
|
+
text = text.replace(/§§projectNS§§/g, capitalizeFirstLetter(o.project));
|
|
44
45
|
text = text.replace(/§§projectID§§/g, capitalizeFirstLetter(o.project));
|
|
45
46
|
text = text.replace(/§§pg_port§§/g, o.pg_port);
|
|
46
47
|
text = text.replace(/§§inbucket_port§§/g, o.inbucket_port);
|
|
@@ -88,7 +89,16 @@ module.exports = function (program) {
|
|
|
88
89
|
process.cwd() + '/' + o.project + '/.project',
|
|
89
90
|
JSON.stringify(o)
|
|
90
91
|
);
|
|
92
|
+
var gitignore = fs.readFileSync(__dirname + '/.gitignore', 'utf-8');
|
|
93
|
+
fs.writeFileSync(
|
|
94
|
+
process.cwd() + '/' + o.project + '/.gitignore',
|
|
95
|
+
gitignore
|
|
96
|
+
);
|
|
91
97
|
spinner.succeed(`projet ${o.project} crée avec succès.`);
|
|
98
|
+
console.log('\n');
|
|
99
|
+
console.log('cd ' + o.project);
|
|
100
|
+
console.log('cd ' + o.project);
|
|
101
|
+
console.log('\n');
|
|
92
102
|
console.log('\n🚀 Happy coding !\n');
|
|
93
103
|
});
|
|
94
104
|
});
|
package/lib/s3.js
CHANGED
package/lib/util.js
CHANGED
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
/** helper utils */
|
|
2
|
+
|
|
3
|
+
/** adding libraries */
|
|
1
4
|
const os = require('os');
|
|
2
5
|
const fs = require('fs');
|
|
3
6
|
const util = require('util');
|
|
4
7
|
const userHomeDir = os.homedir();
|
|
5
8
|
const log = require('log-beautify');
|
|
6
9
|
const readFile = util.promisify(fs.readFile);
|
|
10
|
+
|
|
11
|
+
/** helpers */
|
|
7
12
|
const capitalizeFirstLetter = (string) => {
|
|
8
13
|
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
9
14
|
};
|
package/package.json
CHANGED
package/cmd_available/start.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
module.exports = function (program) {
|
|
2
|
-
program
|
|
3
|
-
.command('start')
|
|
4
|
-
.description('Démarrage des services pour un développement local')
|
|
5
|
-
.action((str, options) => {
|
|
6
|
-
spawn(
|
|
7
|
-
'docker-compose',
|
|
8
|
-
['-f', process.cwd() + '/docker/docker-compose.yml', 'up', '-d'],
|
|
9
|
-
{
|
|
10
|
-
stdio: 'inherit',
|
|
11
|
-
}
|
|
12
|
-
);
|
|
13
|
-
info();
|
|
14
|
-
});
|
|
15
|
-
};
|
package/cmd_available/stop.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
module.exports = function (program) {
|
|
2
|
-
program
|
|
3
|
-
.command('stop')
|
|
4
|
-
.description('Arrête les services')
|
|
5
|
-
.action((str, options) => {
|
|
6
|
-
console.log(chalk.white('Arrêter les services du Cadriciel'));
|
|
7
|
-
spawn(
|
|
8
|
-
'docker-compose',
|
|
9
|
-
['-f', process.cwd() + '/docker/docker-compose.yml', 'down'],
|
|
10
|
-
{
|
|
11
|
-
stdio: 'inherit',
|
|
12
|
-
}
|
|
13
|
-
);
|
|
14
|
-
log.success('OK');
|
|
15
|
-
});
|
|
16
|
-
};
|