Browse Source

Fix typos referring to CLI args in init command (#921)

* Fix typo referring to dev path cli arg

The devPath config variable is set to a non-existent command line arg
`argv.p`, it should be `argv.P`

So if the devPath is set via a command line argument, it defaults
to the default value:

```
/home/projects/example2
⟩ yarn tauri init -P http://THISDOESNOTHING
yarn run v1.22.4
$ /home/projects/example2/node_modules/.bin/tauri init -P http://THISDOESNOTHING
[tauri]: running init
? What is your app name? example2
? What should the window title be? Tauri App
? Where are your web assets (HTML/CSS/JS) located, relative to the "<current dir>/src-tauri" folder that will be created? ../dist
 dependency:manager Installing missing dependencies... +0ms
 dependency:cargo-commands "tauri-bundler" is already installed +18ms
 app:spawn [sync] Running "cargo generate-lockfile" +2ms

    Updating crates.io index
 dependency:crates "tauri" is already installed +941ms
 dependency:npm-packages "tauri" is already installed +1s
Done in 6.35s.

/home/projects/example2
⟩ cat ./src-tauri/tauri.conf.json | grep THISDOESNOTHING

/home/projects/example2
```

* Fix similar typo affecting the window title param

* Add change file
Zak Patterson 5 năm trước cách đây
mục cha
commit
e1fd626453
2 tập tin đã thay đổi với 8 bổ sung2 xóa
  1. 6 0
      .changes/921-fix-cli-args.md
  2. 2 2
      cli/tauri.js/bin/tauri-init.js

+ 6 - 0
.changes/921-fix-cli-args.md

@@ -0,0 +1,6 @@
+---
+"tauri.js": patch
+---
+
+Fix command line arguments -W (window title) and -P (dev server uri) to work as intended.
+

+ 2 - 2
cli/tauri.js/bin/tauri-init.js

@@ -124,11 +124,11 @@ async function runInit(config = {}) {
     customConfig: merge(configOptions, {
       build: {
         distDir: argv.D,
-        devPath: argv.p
+        devPath: argv.P
       },
       tauri: {
         window: {
-          title: argv.w
+          title: argv.W
         }
       }
     })