Skip to content

How to use && and base on windows ? #2249

@joeblew999

Description

@joeblew999

Description

Trying to do a cd into a folder. Windows hates it

Trying to do a base name on a URL. Windows hates it.

both work fine on Unix.

Not sure what the options are for me... Maybe there is something I am missing.

Version

latest

Operating system

windows

Experiments Enabled

Remote Taskfiles

Example Taskfile

# yaml-language-server: $schema=https://taskfile.dev/schema.json

version: '3'

vars:
  
  GIT_VAR_ROOT_ORG_NAME:
    # ISSUE: Windows hates the folder jump using "&&"
    sh: 'cd {{.USER_WORKING_DIR}} && {{.GIT_BIN_NAME}} config --get user.name'
    
  GIT_VAR_ROOT_REPO_URL: 
    sh: 'cd {{.USER_WORKING_DIR}} && {{.GIT_BIN_NAME}} config --get remote.origin.url'

  GIT_VAR_ROOT_REPO_NAME: 
    #  Windows hates basename on   File Paths. Works on Unix.
    sh: 'cd {{.USER_WORKING_DIR}} && basename {{.GIT_VAR_ROOT_REPO_URL}}'

Metadata

Metadata

Assignees

No one assigned

    Labels

    state: needs triageWaiting to be triaged by a maintainer.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions