asdf-vm / asdf-vm/asdf-plugin-template

Non-working `sed` usage on macOS (GNU vs BSD `sed`)

Open
#85 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Shell
Stars
134
Forks
54
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**

The usage of `sed` in this template fails in macOS, i.e. with:
- `invalid command code v`
- `No such file or directory`

(see details below)

**Steps to reproduce**

1. Generate a new repo based on this template.
2. Run `bash setup.bash` (on a Mac).

**Expected behavior**

1. [...]
2. `sed` not giving warnings as below.

**Screenshots**

```
After confirmation, the `main` will be replaced with the generated
template using the above information. Please ensure all seems correct.
Type `yes` if you want to continue.
> yes

Switched to branch 'template'
Preparing worktree (detached HEAD 81a8d50)
HEAD is now at 81a8d50 Initial commit
Switched to a new branch 'out'
sed: 1: "/Users/vs/src/mpv/asdf- ...": invalid command code v
sed: \033[35m.gitlab-ci.yml\033[m: No such file or directory
sed: \033[35mREADME-github.md\033[m: No such file or directory
sed: \033[35mREADME-gitlab.md\033[m: No such file or directory
sed: \033[35mcontributing-github.md\033[m: No such file or directory
sed: \033[35mcontributing-gitlab.md\033[m: No such file or directory
setup.bash: line 111: lib/utils.bash.sed: No such file or directory
sed: \033[35mREADME-github.md\033[m: No such file or directory
sed: \033[35mREADME-gitlab.md\033[m: No such file or directory
setup.bash: line 111: lib/utils.bash.sed: No such file or directory
setup.bash: line 111: .github/workflows/build.yml.sed: No such file or directory
sed: \033[35m.gitlab-ci.yml\033[m: No such file or directory
sed: \033[35mREADME-github.md\033[m: No such file or directory
sed: \033[35mREADME-gitlab.md\033[m: No such file or directory
sed: \033[35mcontributing-github.md\033[m: No such file or directory
sed: \033[35mcontributing-gitlab.md\033[m: No such file or directory
setup.bash: line 111: lib/utils.bash.sed: No such file or directory
sed: \033[35mREADME-github.md\033[m: No such file or directory
sed: \033[35mREADME-gitlab.md\033[m: No such file or directory
sed: \033[35mREADME-github.md\033[m: No such file or directory
sed: \033[35mcontributing-github.md\033[m: No such file or directory
sed: \033[35mREADME-gitlab.md\033[m: No such file or directory
rm '.gitlab-ci.yml'
rm '.gitlab/issue_templates/Bug_Report.md'
rm '.gitlab/issue_templates/Feature_Request.md'
rm '.gitlab/merge_request_templates/Merge_Request.md'
rm 'README-gitlab.md'
rm 'contributing-gitlab.md'
[out (root-commit) 5072db0] Generate asdf-octopilot plugin from template.
26 files changed, 441 insertions(+)
create mode 100644 "\033[35m.gitlab-ci.yml\033[m.sed"
create mode 100644 "\033[35mREADME-github.md\033[m.sed"
create mode 100644 "\033[35mREADME-gitlab.md\033[m.sed"
create mode 100644 "\033[35mcontributing-github.md\033[m.sed"
create mode 100644 "\033[35mcontributing-gitlab.md\033[m.sed"
create mode 100644 .editorconfig
create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md
create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md
create mode 100644 .github/PULL_REQUEST/pull_request_template.md
create mode 100644 .github/dependabot.yml
create mode 100644 .github/workflows/build.yml
create mode 100644 .github/workflows/lint.yml
create mode 100644 .github/workflows/release.yml
create mode 100644 .github/workflows/semantic-pr.yml
create mode 100644 .tool-versions
create mode 100644 LICENSE
create mode 100644 README.md
create mode 100755 bin/download
create mode 100755 bin/install
create mode 100755 bin/latest-stable
create mode 100755 bin/list-all
create mode 100644 contributing.md
create mode 100755 lib/utils.bash
create mode 100755 scripts/format.bash
create mode 100755 scripts/lint.bash
create mode 100644 version.txt
Switched to branch 'main'
Your branch and 'origin/main' have diverged,
and have 1 and 1 different commits each, respectively.
(use "git pull" if you want to integrate the remote branch with yours)
All done.
Your main branch has been reset to an initial commit.
Push to origin/main with `git push --force-with-lease`
Review these TODO items:
[...]
```

**Additional context**

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with setup.bash, especially line 111 and the sed invocations involved in generating files. Reproduce the issue by running bash setup.bash on macOS, then verify that generation completes without sed warnings, missing-file errors, or malformed filenames such as the escaped-color .sed files.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.