@sdeverywhere/cli 0.7.40 → 0.7.41
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 +3 -3
- package/src/sde-generate.js +10 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sdeverywhere/cli",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.41",
|
|
4
4
|
"description": "Contains the `sde` command line interface for the SDEverywhere tool suite.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"sde": "src/main.js"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@sdeverywhere/build": "^0.3.
|
|
15
|
-
"@sdeverywhere/compile": "^0.7.
|
|
14
|
+
"@sdeverywhere/build": "^0.3.12",
|
|
15
|
+
"@sdeverywhere/compile": "^0.7.29",
|
|
16
16
|
"byline": "^5.0.0",
|
|
17
17
|
"ramda": "^0.27.0",
|
|
18
18
|
"shelljs": "^0.10.0",
|
package/src/sde-generate.js
CHANGED
|
@@ -34,6 +34,10 @@ export let builder = {
|
|
|
34
34
|
type: 'string',
|
|
35
35
|
alias: 's'
|
|
36
36
|
},
|
|
37
|
+
datadir: {
|
|
38
|
+
describe: 'directory to use for resolving data file paths',
|
|
39
|
+
type: 'string'
|
|
40
|
+
},
|
|
37
41
|
builddir: {
|
|
38
42
|
describe: 'build directory',
|
|
39
43
|
type: 'string',
|
|
@@ -60,6 +64,12 @@ export let generate = async (model, opts) => {
|
|
|
60
64
|
let { modelDirname, modelName, modelPathname, modelKind } = modelPathProps(model)
|
|
61
65
|
// Ensure the build directory exists.
|
|
62
66
|
let buildDirname = buildDir(opts.builddir, modelDirname)
|
|
67
|
+
// Allow for overriding the directory that is used for resolving data file paths
|
|
68
|
+
// referenced by the model. If `--datadir` is not specified, data files will be
|
|
69
|
+
// resolved relative to the directory of the provided model file.
|
|
70
|
+
if (opts.datadir) {
|
|
71
|
+
modelDirname = path.resolve(opts.datadir)
|
|
72
|
+
}
|
|
63
73
|
let spec = parseSpec(opts.spec)
|
|
64
74
|
let mdlContent = readFileSync(modelPathname, 'utf8')
|
|
65
75
|
if (opts.preprocess) {
|