Skip to content

Commit

Permalink
fix manual windows
Browse files Browse the repository at this point in the history
  • Loading branch information
mendescole committed Sep 11, 2023
1 parent febc720 commit d5e2810
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions misc/manual/task_windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,21 @@ tasks:
'
prompt_value:
deps: [gum].,
deps: [gum]
requires:
vars: [INSTRUCTIONS, OUTPUT_TEMPLATE, OUTPUT_FILE, OUTPUT_APPEND, IS_SECRET]
status:
- |
powershell '
{{if eq .IS_SECRET "true"}}
Select-String -Path .\.env -Pattern "^BUNDLE_DUTCHIE__JFROG__IO=.*"
{{else}}
Select-String -Path .\.env -Pattern "^NPM_CONFIG__AUTH=.*"
{{end}}
'
cmds:
- echo "{{.INSTRUCTIONS}}"
- |
powershell '
$PATTERN = "^{{.OUTPUT_TEMPLATE}}.*"
$SECRET = gum\gum.exe input {{if eq .IS_SECRET "true"}}--password{{end}} --prompt "{{.INPUT_PROMPT}}" --placeholder "{{.INPUT_PLACEHOLDER}}"
$VALUE="{{.OUTPUT_TEMPLATE}}"
{{if eq .OUTPUT_APPEND "true"}}
echo "$VALUE" >> {{.OUTPUT_FILE}}
{{else}}
echo "$VALUE" > {{.OUTPUT_FILE}}
{{end}}
$VALUE = "{{.OUTPUT_TEMPLATE}}"
echo $pattern
$env = (Get-Content .env) -replace $PATTERN, $VALUE
Set-Content -Path .env -Value $env
'
fetch:
requires:
vars: [KEY, FIELDS, OUTPUT]
Expand Down

0 comments on commit d5e2810

Please sign in to comment.