Prechádzať zdrojové kódy

fix(cli.js): skip installing deps when `--ci` is passed on `tauri init` (#1603)

Lucas Fernandes Nogueira 4 rokov pred
rodič
commit
941585c0c5

+ 5 - 0
.changes/tauri-init-ci-fix.md

@@ -0,0 +1,5 @@
+---
+"cli.js": patch
+---
+
+Do not prompt to install dependencies on `tauri init` when the `--ci` argument is passed.

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

@@ -19,7 +19,7 @@ const cmd = process.argv[2]
  */
 const tauri = async function (command) {
   // notifying updates.
-  if (!(process.argv || []).some((arg) => arg === '--no-update-notifier')) {
+  if (!process.argv.some((arg) => arg === '--no-update-notifier')) {
     updateNotifier({
       pkg,
       updateCheckInterval: 0
@@ -42,7 +42,7 @@ const tauri = async function (command) {
         (process.argv || []).filter((v) => v !== '--no-update-notifier')
       )
     ).promise.then(() => {
-      if (command === 'init') {
+      if (command === 'init' && !process.argv.some((arg) => arg === '--ci')) {
         const {
           installDependencies
         } = require('../dist/api/dependency-manager')