codesysultra 1.0.3 → 1.0.4
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/bin.js +8 -13
- package/package.json +1 -1
- package/test_config.json +13 -0
package/dist/bin.js
CHANGED
|
@@ -66,20 +66,15 @@ commander_1.program
|
|
|
66
66
|
.version(version)
|
|
67
67
|
.option('-p, --codesys-path <path>', 'Path to CODESYS executable (can contain spaces, use quotes if needed)', process.env.CODESYS_PATH || 'C:\\Program Files\\CODESYS 3.5.21.0\\CODESYS\\Common\\CODESYS.exe')
|
|
68
68
|
.option('-f, --codesys-profile <profile>', 'CODESYS profile name (overrides CODESYS_PROFILE env var)', process.env.CODESYS_PROFILE || 'CODESYS V3.5 SP21')
|
|
69
|
-
.option('-w, --workspace <dir>', 'Workspace directory for relative project paths', process.cwd())
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
.
|
|
73
|
-
.option('-c, --codesys-path <path>', 'Path to CODESYS executable')
|
|
74
|
-
.option('-v, --version-info <path>', 'Path to CODESYS version info file')
|
|
75
|
-
.option('-o, --output <path>', 'Output configuration file path (optional, prints to console if not specified)')
|
|
76
|
-
.action((options) => {
|
|
77
|
-
generateConfig(options);
|
|
78
|
-
});
|
|
69
|
+
.option('-w, --workspace <dir>', 'Workspace directory for relative project paths', process.cwd())
|
|
70
|
+
.option('-g, --generate-config', 'Generate configuration file from CODESYS version info (use with -c and -v)')
|
|
71
|
+
.option('-v, --version-info <path>', 'Path to CODESYS version info file (for config generation)')
|
|
72
|
+
.option('-o, --output <path>', 'Output configuration file path (for config generation)');
|
|
79
73
|
commander_1.program.parse(process.argv); // Parse the arguments
|
|
80
74
|
const options = commander_1.program.opts();
|
|
81
|
-
//
|
|
82
|
-
if (
|
|
75
|
+
// 如果是生成配置模式
|
|
76
|
+
if (options.generateConfig) {
|
|
77
|
+
generateConfig(options);
|
|
83
78
|
process.exit(0);
|
|
84
79
|
}
|
|
85
80
|
// --- Log options Commander parsed ---
|
|
@@ -121,7 +116,7 @@ function generateConfig(options) {
|
|
|
121
116
|
process.exit(1);
|
|
122
117
|
}
|
|
123
118
|
if (!options.codesysPath) {
|
|
124
|
-
console.error('Error: CODESYS path is required. Use -
|
|
119
|
+
console.error('Error: CODESYS path is required. Use -p or --codesys-path option.');
|
|
125
120
|
process.exit(1);
|
|
126
121
|
}
|
|
127
122
|
const versionInfoPath = path.resolve(options.versionInfo);
|
package/package.json
CHANGED
package/test_config.json
ADDED