@ovipakla/gm-cli 2.0.3 → 2.1.0

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.
Files changed (2) hide show
  1. package/app.js +19 -5
  2. package/package.json +1 -1
package/app.js CHANGED
@@ -1,4 +1,4 @@
1
- #! /usr/bin/env node
1
+ #! /usr/bin/env node
2
2
 
3
3
  import { watch, sync } from './GMFileWatcher.js';
4
4
  import path from 'node:path';
@@ -337,6 +337,17 @@ program
337
337
  console.log(`📝 Backup yyp:`, yypOldPath);
338
338
  fs.copyFileSync(yypPath, yypOldPath);
339
339
 
340
+
341
+ const vsDevCmdPath = envMap.get("GM_CLI_VS_DEV_CMD_PATH")
342
+ if (vsDevCmdPath !== undefined) {
343
+ const localSettings = path.join(path.normalize(path.dirname(yypPath)), "local_settings.json").replaceAll("\\", "/")
344
+ const localSettingsJson = {
345
+ "machine.Platform Settings.Windows.visual_studio_path": vsDevCmdPath
346
+ }
347
+ fs.writeFileSync(localSettings, JSON.stringify(localSettingsJson, null, 2), "utf8");
348
+ }
349
+
350
+
340
351
  const datafilesPath = path.join(projectPath, "datafiles").replaceAll("\\", "/")
341
352
  const datafiles = getFilesRecursively(datafilesPath, datafilesPath)
342
353
  const replaced = yyp.replace(/"IncludedFiles"\s*:\s*\[(.*?)\]/s, `"IncludedFiles":[
@@ -504,7 +515,7 @@ program
504
515
  log_info "Clean '$\{project_path\}/tmp/igor/out'"
505
516
  rm -rf $\{project_path\}/tmp/igor/out
506
517
 
507
- log_info "Execute shell command:\n\\\e[33m$igor_path \\ \n --project="$\{project_path\}/$\{project_yyp\}" \\ \n --user="$user_path" \\ \n --runtimePath="$runtime_path" \\ \n --runtime=$runtime \\ \n --cache="$\{project_path\}/tmp/igor/cache" \\ \n --temp="$\{project_path\}/tmp/igor/temp" \\ \n --of="$\{project_path\}/tmp/igor/out/$\{project_name\}.win" \\ \n --tf="$\{zip_name\}.zip" \\ \n --projectool="$\{project_tool\}" \\ \n -- $target ${config.launch}\\\e[0m"
518
+ log_info "Execute shell command:\n\\\e[33m$igor_path \\ \n --project="$\{project_path\}/$\{project_yyp\}" \\ \n --user="$user_path" \\ \n --runtimePath="$runtime_path" \\ \n --runtime=$runtime \\ \n --cache="$\{project_path\}/tmp/igor/cache" \\ \n --temp="$\{project_path\}/tmp/igor/temp" \\ \n --of="$\{project_path\}/tmp/igor/out/$\{project_name\}.win" \\ \n --tf="$\{zip_name\}.zip" \\ \n --projectool="$\{project_tool\}" \\ \n --uf="$user_path" \\ \n -- $target ${config.launch}\\\e[0m"
508
519
  $igor_path \
509
520
  --project="$\{project_path\}/$\{project_yyp\}" \
510
521
  --user="$user_path" \
@@ -515,6 +526,7 @@ program
515
526
  --of="$\{project_path\}/tmp/igor/out/$\{project_name\}.win" \
516
527
  --tf="$\{zip_name\}.zip" \
517
528
  --projectool="$\{project_tool\}" \
529
+ --uf="$user_path" \
518
530
  -- $target ${config.launch} | GREP_COLORS='mt=01;31' grep --color=always -E 'Error : |$'
519
531
 
520
532
  exit 0
@@ -545,12 +557,14 @@ program
545
557
  const propertyProjectoolPath = await askQuestion('Path to ProjectTool.exe: ');
546
558
  const propertyRuntimePath = await askQuestion('Path to gamemaker runtime: ');
547
559
  const propertyUserPath = await askQuestion('Path to gamemaker user: ');
560
+ const propertyVsDevCmdPath = await askQuestion('Path to VsDevCmd.bat: ');
548
561
  const data = {
549
562
  GM_CLI_DEFAULT_RUNTIME: runtimes.includes(propertyDefaultRuntime) ? propertyDefaultRuntime : runtimes[0],
550
563
  GM_CLI_DEFAULT_TARGET: runtimes.includes(propertyDefaultTarget) ? propertyDefaultTarget : targets[0],
551
564
  GM_CLI_PROJECT_TOOL_PATH: path.normalize(propertyProjectoolPath),
552
565
  GM_CLI_RUNTIME_PATH: path.normalize(propertyRuntimePath),
553
- GM_CLI_USER_PATH: path.normalize(propertyUserPath)
566
+ GM_CLI_USER_PATH: path.normalize(propertyUserPath),
567
+ GM_CLI_VS_DEV_CMD_PATH: path.normalize(propertyVsDevCmdPath),
554
568
  };
555
569
 
556
570
  const filePath = path.join(projectPath, '.gm-cli.env');
@@ -827,7 +841,7 @@ resource
827
841
  .description("Delete a resource")
828
842
  .requiredOption("-n, --name <name>", "Resource name")
829
843
  .option("--type <type>", "Resource type")
830
- .action((name, options) => {
844
+ .action((options) => {
831
845
  const packageGM = getPackageGM()
832
846
  const yypPath = getYYPPathFromPackageGM(packageGM)
833
847
  const typeOptions = options.type !== undefined ? `type=${options.type}` : ``
@@ -839,7 +853,7 @@ resource
839
853
  .command("list")
840
854
  .description("List resources")
841
855
  .option("--type <type>", "Resource type")
842
- .action((name, options) => {
856
+ .action((options) => {
843
857
  const packageGM = getPackageGM()
844
858
  const yypPath = getYYPPathFromPackageGM(packageGM)
845
859
  const typeOptions = options.type !== undefined ? `type=${options.type}` : ``
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "2.0.3",
6
+ "version": "2.1.0",
7
7
  "description": "Gamemaker CLI toolkit. Watch &amp; sync gml sources with yyp project.",
8
8
  "main": "app.js",
9
9
  "scripts": {},