How to remove the need for include prefixes ? #2182
-
I am still learning, and trying to get things modular for the team. As you can see in my little example, I have to change the prefix on the task calls, depending on if I am using a local or remote include. I think there might be a way to make it so I dont need to ???? # yaml-language-server: $schema=https://taskfile.dev/schema.json
version: '3'
# MUST have this ONLY in root for env variables to work.
dotenv: ['.env', '{{.ENV}}/.env', '{{.HOME}}/.env']
includes:
# TODO: Can i get rid of the need to swap between base and remote ?
base: ./../../../remote-taskfile.yml
#remote:
# taskfile: https://raw.githubusercontent.com/joeblew999/pb-stack/refs/heads/main/remote-taskfile.yml
vars:
# MUST have this to work. Maybe can discover it later in base.
BASE_SRC_NAME: soft_serve
tasks:
default:
cmds:
- task --list-all
- task base:base
- task base:base:bin
- task base:go:bin
- task base:go:run
|
Beta Was this translation helpful? Give feedback.
Answered by
joeblew999
Apr 16, 2025
Replies: 1 comment
-
I worked it out and it works really well. Task is really starting to pay off for me. # yaml-language-server: $schema=https://taskfile.dev/schema.json
version: '3'
# MUST have this ONLY in root for env variables to work.
dotenv: ['.env', '{{.ENV}}/.env', '{{.HOME}}/.env']
includes:
# Pick if you want local or remote task file loading.
# https://taskfile.dev/usage/#flatten-includes makes it all the same either way.
local:
taskfile: ./../../../remote-taskfile.yml
flatten: true
#remote:
# taskfile: https://raw.githubusercontent.com/joeblew999/pb-stack/refs/heads/main/remote-taskfile.yml
# flatten: true
vars:
# MUST have this to work. Maybe can discover it later in base.
BASE_SRC_NAME: soft_serve
tasks:
default:
cmds:
- task --list-all
- task base
- task base:bin
- task go:bin
run:
cmds:
- task go:run
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
joeblew999
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I worked it out and it works really well.
Task is really starting to pay off for me.