@wpmoo/odoo 0.8.53 → 0.8.54
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/dist/cli.js +22 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { confirm, intro, isCancel, note, outro, select, text } from '@clack/prompts';
|
|
3
3
|
import { realpathSync } from 'node:fs';
|
|
4
|
-
import { basename, resolve } from 'node:path';
|
|
4
|
+
import { basename, relative, resolve } from 'node:path';
|
|
5
5
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
6
6
|
import { commandFromArgs, isHelpRequested, isVersionRequested, optionsFromArgs, parseArgs, stripInternalFlags, } from './args.js';
|
|
7
7
|
import { selectCockpitCommandFromPalette } from './cockpit/command-palette.js';
|
|
@@ -92,6 +92,25 @@ function booleanOption(values, key, fallback) {
|
|
|
92
92
|
return false;
|
|
93
93
|
throw new Error(`Invalid boolean value for --${key}: ${value}`);
|
|
94
94
|
}
|
|
95
|
+
function yellow(value) {
|
|
96
|
+
if (!process.stdout.isTTY || process.env.NO_COLOR !== undefined)
|
|
97
|
+
return value;
|
|
98
|
+
return `\u001b[33m${value}\u001b[39m`;
|
|
99
|
+
}
|
|
100
|
+
function shellQuote(value) {
|
|
101
|
+
if (/^[A-Za-z0-9_./:-]+$/.test(value))
|
|
102
|
+
return value;
|
|
103
|
+
return `'${value.replaceAll("'", "'\\''")}'`;
|
|
104
|
+
}
|
|
105
|
+
function renderPostCreateGuidance(target, cwd) {
|
|
106
|
+
const relativeTarget = relative(cwd, target) || '.';
|
|
107
|
+
return yellow([
|
|
108
|
+
'Environment is ready. Enter the development folder, then run the local WPMoo cockpit:',
|
|
109
|
+
'',
|
|
110
|
+
`cd ${shellQuote(relativeTarget)}`,
|
|
111
|
+
'./moo',
|
|
112
|
+
].join('\n'));
|
|
113
|
+
}
|
|
95
114
|
function validateRepoName(value) {
|
|
96
115
|
const normalized = value.trim();
|
|
97
116
|
if (!normalized)
|
|
@@ -674,6 +693,7 @@ export async function runCli(cliArgv = process.argv.slice(2), cwd = process.cwd(
|
|
|
674
693
|
const resolvedOptions = await optionsFromPrompts();
|
|
675
694
|
await ensureGitHubRepositories(resolvedOptions, true);
|
|
676
695
|
await scaffold(resolvedOptions);
|
|
696
|
+
note(renderPostCreateGuidance(resolvedOptions.target, cwd), 'Next steps');
|
|
677
697
|
outro(`Created Odoo dev overlay in ${resolvedOptions.target}. Review staged changes, then commit.`);
|
|
678
698
|
return;
|
|
679
699
|
}
|
|
@@ -803,6 +823,7 @@ export async function runCli(cliArgv = process.argv.slice(2), cwd = process.cwd(
|
|
|
803
823
|
console.log(`- ${command}`);
|
|
804
824
|
return;
|
|
805
825
|
}
|
|
826
|
+
note(renderPostCreateGuidance(resolvedOptions.target, cwd), 'Next steps');
|
|
806
827
|
outro(`Created Odoo dev overlay in ${resolvedOptions.target}. Review staged changes, then commit.`);
|
|
807
828
|
}
|
|
808
829
|
export function isCliEntrypoint(metaUrl, argvPath = process.argv[1]) {
|