Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Create findExecutable which searches multiple paths for an executable of a particular executable and returns the found path. #4

Open
wants to merge 49 commits into
base: master
Choose a base branch
from

Conversation

arran4
Copy link
Owner

@arran4 arran4 commented Aug 8, 2023

feat: Create findExecutable which searches multiple paths for an executable of a particular name and returns the found path.

Resolves: twpayne#3141

I didn't want to squash / force push so much so re-created this. I split out some of the other fixes too.

I think I might need to expose: os.PathListSeparator & os.PathSeparator as chezmoi.osPathListSeparator can you please indicate if that would be well received?

@arran4 arran4 force-pushed the findExecutable branch 2 times, most recently from 60de4b5 to 29e556c Compare August 8, 2023 02:08
@arran4
Copy link
Owner Author

arran4 commented Aug 8, 2023

Sorry if you're getting notifications for here.

@arran4 arran4 changed the title feat: Create findExecutable which searches multiple paths for an executable of a particular name and returns the found path. feat: Create findExecutable which searches multiple paths for an executable of a particular executable and returns the found path. Aug 8, 2023
@arran4 arran4 force-pushed the findExecutable branch 3 times, most recently from 1b46c10 to 4080e6f Compare August 8, 2023 07:02
…ecutable of a particular name and returns the found path.

As per: twpayne#3141
osalbahr and others added 27 commits August 19, 2023 09:34
[Homebrew on Linux was formerly referred to as Linuxbrew](https://docs.brew.sh/Homebrew-on-Linux). The two projects got merged.
The discussion in twpayne#3198 suggests some confusion about the order of
application. This adds a little more context.
The test for `.chezmoi.targetFile` is excluded from tests because of the
difference in path separators.

Resolves twpayne#3203
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 3.6.0 to 3.7.0.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](golangci/golangci-lint-action@639cd34...3a91952)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [actions/checkout](https://github.com/actions/checkout) from 3.5.3 to 3.6.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@c85c95e...f43a0e5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action) from 4.3.0 to 4.4.0.
- [Release notes](https://github.com/goreleaser/goreleaser-action/releases)
- [Commits](goreleaser/goreleaser-action@336e299...3fa32b8)

---
updated-dependencies:
- dependency-name: goreleaser/goreleaser-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 4.0.1 to 4.1.0.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](actions/setup-go@fac708d...93397be)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2.21.2 to 2.21.5.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@0ba4244...00e563e)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
The added documentation serves as the rationale for this documentation
change:

If you use `fish` as your primary shell, you may get warnings from Fish
during the `.txtar` tests:

```
error: can not save history
warning-path: Unable to locate data directory derived from $HOME: '/home/user/.local/share/fish'.
warning-path: The error was 'Operation not supported'.
warning-path: Please set $HOME to a directory where you have write access.
```

These can be avoided with by running tests with `SHELL=bash` or
`SHELL=zsh`:

```console
$ SHELL=bash make test
$ SHELL=zsh make smoketest
$ SHELL=bash go test ./...
```

---

As a note, I tried to make `make test` re-execute when under `fish`, but
it requires some GNU make magic that may not work on all systems:

```Makefile
.PHONY: test
test:
ifeq ($(shell echo $$SHELL | grep -c fish$$),1)
	SHELL=$(SHELL) $(MAKE) test
else
	${GO} test -ldflags="-X github.com/twpayne/chezmoi/v2/internal/chezmoitest.umaskStr=0o022" ./...
	${GO} test -ldflags="-X github.com/twpayne/chezmoi/v2/internal/chezmoitest.umaskStr=0o002" ./...
endif
```

This can be added to this PR or made as a separate PR, if desired.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

lookPath should accept an optional path override
6 participants