From f73ae55f0379f9a495b7cf379845fbc3817073fd Mon Sep 17 00:00:00 2001 From: JenChieh Date: Tue, 19 Sep 2023 18:42:07 -0700 Subject: [PATCH] fix(run): Workaround for run command (again) --- cmds/core/run.js | 1 - lisp/_prepare.el | 3 +++ lisp/core/run.el | 11 ++++++----- src/util.js | 1 + 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/cmds/core/run.js b/cmds/core/run.js index dbf61220..8150b536 100644 --- a/cmds/core/run.js +++ b/cmds/core/run.js @@ -100,7 +100,6 @@ function spawn(command, options) { * @return Return updated command array. */ function replaceEaskExec(cmds) { - if (!IS_PKG) return; for (let index = 0; index < cmds.length; ++index) { if (cmds[index] == "eask") { cmds[index] = process.argv[1]; // XXX: This is `/snapshot/cli/eask` diff --git a/lisp/_prepare.el b/lisp/_prepare.el index 4c1eae0a..0bce38b0 100644 --- a/lisp/_prepare.el +++ b/lisp/_prepare.el @@ -75,6 +75,9 @@ Arguments FNC and ARGS are used for advice `:around'." (defconst eask-invocation (getenv "EASK_INVOCATION") "Eask invocation program.") +(defconst eask-is-pkg (getenv "EASK_IS_PKG") + "Eask is pkg.") + ;; ;;; Execution diff --git a/lisp/core/run.el b/lisp/core/run.el index cf55cbdf..08ce8663 100644 --- a/lisp/core/run.el +++ b/lisp/core/run.el @@ -38,11 +38,12 @@ (defun eask--export-command (command) "Export COMMAND instruction." (ignore-errors (make-directory eask-homedir t)) ; generate dir `~/.eask/' - ;; XXX: Due to `MODULE_NOT_FOUND` not found error from vcpkg, - ;; see https://github.com/vercel/pkg/issues/1356. - ;; - ;; We must split up all commands! - (setq command (eask-s-replace " && " "\n" command)) + (when eask-is-pkg + ;; XXX: Due to `MODULE_NOT_FOUND` not found error from vcpkg, + ;; see https://github.com/vercel/pkg/issues/1356. + ;; + ;; We must split up all commands! + (setq command (eask-s-replace " && " "\n" command))) (write-region (concat command "\n") nil eask--run-file t)) (defun eask--unmatched-scripts (scripts) diff --git a/src/util.js b/src/util.js index 3908113b..414278aa 100644 --- a/src/util.js +++ b/src/util.js @@ -120,6 +120,7 @@ function setup_env() { /* Home Directory */ process.env.EASK_INVOCATION = _invocation(); process.env.EASK_HOMEDIR = EASK_HOMEDIR; + if (IS_PKG) process.env.EASK_IS_PKG = IS_PKG; if (GITHUB_ACTIONS) { /* XXX: isTTY flag will always be undefined in GitHub Actions; we will have