Skip to content

Commit

Permalink
Merge pull request #253 from lets-cli/fix-bash-resolving-error
Browse files Browse the repository at this point in the history
do not set SHELL to avoid bash: file not found error. set LETS_SHELL …
  • Loading branch information
kindermax authored Aug 11, 2023
2 parents 568bc46 + cbdd16f commit 9c14c26
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# vendor/
.idea
.vscode
!.vscode/launch.json
.history
dist

Expand All @@ -26,3 +27,6 @@ _lets
coverage.out
node_modules
TODO

.DS_Store
__debug_bin*
23 changes: 23 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch Package",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${fileDirname}"
},
{
"name": "Run",
"type": "go",
"request": "launch",
"mode": "auto",
"program": "${workspaceRoot}",
"args": []
}
]
}
4 changes: 4 additions & 0 deletions docs/docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ title: Changelog

## [Unreleased](https://github.com/lets-cli/lets/releases/tag/v0.0.X)

## [0.0.53](https://github.com/lets-cli/lets/releases/tag/v0.0.53)

* `[Fixed]` change `SHELL` env to `LETS_SHELL` because setting system variable `SHELL` to just `bash` without full path to binary cases and error in some cases.

## [0.0.52](https://github.com/lets-cli/lets/releases/tag/v0.0.52)

* `[Dependency]` update and pin goreleaser
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/env.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ title: Environment
* `LETS_COMMAND_WORK_DIR` - absolute path to `work_dir` specified in command.
* `LETS_CONFIG` - absolute path to lets config file.
* `LETS_CONFIG_DIR` - absolute path to lets config file firectory.
* `SHELL` - shell from config or command.
* `LETS_SHELL` - shell from config or command.
* `LETSOPT_<>` - options parsed from command `options` (docopt string). E.g `lets run --env=prod --reload` will be `LETSOPT_ENV=prod` and `LETSOPT_RELOAD=true`
* `LETSCLI_<>` - options which values is a options usage. E.g `lets run --env=prod --reload` will be `LETSCLI_ENV=--env=prod` and `LETSCLI_RELOAD=--reload`

Expand Down
2 changes: 1 addition & 1 deletion executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func (e *Executor) setupEnv(osCmd *exec.Cmd, command *config.Command, shell stri
"LETS_COMMAND_WORK_DIR": osCmd.Dir,
"LETS_CONFIG": filepath.Base(e.cfg.FilePath),
"LETS_CONFIG_DIR": filepath.Dir(e.cfg.FilePath),
"SHELL": shell,
"LETS_SHELL": shell,
}

checksumEnvMap := getChecksumEnvMap(command.ChecksumMap)
Expand Down
2 changes: 1 addition & 1 deletion lets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,4 @@ commands:

run-docs:
work_dir: docs
cmd: npm start
cmd: npm start
2 changes: 1 addition & 1 deletion tests/command_shell/lets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ shell: bash
commands:
show-shell:
shell: /bin/sh
cmd: echo "$SHELL"
cmd: echo "$LETS_SHELL"

0 comments on commit 9c14c26

Please sign in to comment.