Skip to content

Doesn't work while trying to source script providing required functions #554

@anton-fomin

Description

@anton-fomin
  • Task version: v3.7.0 (h1:8dDFv12/Lxi6PHkYNIIm7N6v6oRGxePpLK67LuMh/Rs=)
  • Operating System: linux

Prerequisites

Install NVM as described here https://github.com/nvm-sh/nvm#installing-and-updating

Example Taskfile showing the issue

version: '3'

tasks:
  nvm-install:
    cmds:
      - |
        [ -z "$NVM_DIR" ] && export NVM_DIR="$HOME/.nvm";
        [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh";
        [ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh";
        nvm install

The problem

It doesn't work

> task nvm-install
task: [nvm-install] [ -z "$NVM_DIR" ] && export NVM_DIR="$HOME/.nvm";
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh";
[ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh";
nvm install

task: Failed to run task "nvm-install": exit status 3

I tried to replace . with source without any change.
-verbose doesn't give any additional information.

That is required for my workflow to make sure the commands run with correct node version

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No fields configured for bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions