@zhouchangui/math-ati 0.1.1 → 0.1.2
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/bin/math-ati.js +3 -1
- package/package.json +1 -1
package/bin/math-ati.js
CHANGED
|
@@ -12,8 +12,10 @@ const packageRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '
|
|
|
12
12
|
const templateRoot = path.join(packageRoot, 'templates', 'workspace');
|
|
13
13
|
const requireFromCli = createRequire(import.meta.url);
|
|
14
14
|
const execFileAsync = promisify(execFile);
|
|
15
|
+
const packageJson = JSON.parse(await readFile(path.join(packageRoot, 'package.json'), 'utf8'));
|
|
15
16
|
const DEFAULT_CURRICULUM_ID = 'rj-7a';
|
|
16
17
|
const DEFAULT_CURRICULUM_PACKAGE = '@zhouchangui/math-ati-curriculum-rj-7a';
|
|
18
|
+
const DEFAULT_CURRICULUM_PACKAGE_SPEC = `${DEFAULT_CURRICULUM_PACKAGE}@${packageJson.version}`;
|
|
17
19
|
|
|
18
20
|
function printHelp() {
|
|
19
21
|
console.log(`math-ati
|
|
@@ -180,7 +182,7 @@ async function resolveCurriculumDataRoot(flags) {
|
|
|
180
182
|
|
|
181
183
|
const spec = flags['curriculum-package']
|
|
182
184
|
|| process.env.MATH_ATI_CURRICULUM_PACKAGE_SPEC
|
|
183
|
-
||
|
|
185
|
+
|| DEFAULT_CURRICULUM_PACKAGE_SPEC;
|
|
184
186
|
const packageName = packageNameFromSpec(spec);
|
|
185
187
|
let curriculumPackageRoot = await localCurriculumPackageRoot(packageName);
|
|
186
188
|
let installed = false;
|