valent-pipeline 0.2.12 → 0.2.13
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 +1 -1
- package/src/commands/init.js +14 -3
package/package.json
CHANGED
package/src/commands/init.js
CHANGED
|
@@ -29,9 +29,9 @@ export async function init(options = {}) {
|
|
|
29
29
|
|
|
30
30
|
console.log('\nInitializing valent-pipeline...\n');
|
|
31
31
|
|
|
32
|
-
// 0.
|
|
33
|
-
if (!existsSync(join(projectRoot, '.git'))) {
|
|
34
|
-
console.log('
|
|
32
|
+
// 0. Initialize git repo if needed
|
|
33
|
+
if (!existsSync(join(projectRoot, '.git')) && (options.yes || config.init_git)) {
|
|
34
|
+
console.log(' Initializing git repository...');
|
|
35
35
|
const { execSync } = await import('child_process');
|
|
36
36
|
execSync('git init', { cwd: projectRoot, stdio: 'pipe' });
|
|
37
37
|
console.log(' Initialized git repository');
|
|
@@ -178,6 +178,17 @@ async function runWizard() {
|
|
|
178
178
|
|
|
179
179
|
console.log('\n valent-pipeline init\n');
|
|
180
180
|
|
|
181
|
+
// Git repo check
|
|
182
|
+
if (!existsSync(join(process.cwd(), '.git'))) {
|
|
183
|
+
const { initGit } = await inquirer.prompt([{
|
|
184
|
+
type: 'confirm',
|
|
185
|
+
name: 'initGit',
|
|
186
|
+
message: 'No git repository detected. Initialize one?',
|
|
187
|
+
default: true,
|
|
188
|
+
}]);
|
|
189
|
+
config.init_git = initGit;
|
|
190
|
+
}
|
|
191
|
+
|
|
181
192
|
// Project type
|
|
182
193
|
const { projectType } = await inquirer.prompt([{
|
|
183
194
|
type: 'list',
|