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

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

Open
MPV opened this issue Dec 8, 2023 · 1 comment
Open

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

MPV opened this issue Dec 8, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@MPV
Copy link

MPV commented Dec 8, 2023

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

@MPV MPV added the bug Something isn't working label Dec 8, 2023
@MPV
Copy link
Author

MPV commented Dec 8, 2023

I tried again locally by:

  1. git reset --hard origin/main (to get rid of any changes above)
  2. Changing (between step 1 & 2) these occurrences of sed into gsed:
  1. I ran bash setup.bash but still got output containing:
[...]
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'
gsed: can't read .gitlab-ci.yml: No such file or directory
gsed: can't read README-github.md: No such file or directory
gsed: can't read README-gitlab.md: No such file or directory
gsed: can't read contributing-github.md: No such file or directory
gsed: can't read contributing-gitlab.md: No such file or directory
setup.bash: line 111: lib/utils.bash.sed: No such file or directory
gsed: can't read README-github.md: No such file or directory
gsed: can't read README-gitlab.md: 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
gsed: can't read .gitlab-ci.yml: No such file or directory
gsed: can't read README-github.md: No such file or directory
gsed: can't read README-gitlab.md: No such file or directory
gsed: can't read contributing-github.md: No such file or directory
gsed: can't read contributing-gitlab.md: No such file or directory
setup.bash: line 111: lib/utils.bash.sed: No such file or directory
gsed: can't read README-github.md: No such file or directory
gsed: can't read README-gitlab.md: No such file or directory
gsed: can't read README-github.md: No such file or directory
gsed: can't read contributing-github.md: No such file or directory
gsed: can't read README-gitlab.md: 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) d4b2431] Generate asdf-octopilot plugin from template.
 26 files changed, 442 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:
[...]
[...]

And (as seen above) I've gotten files named like this (which surprised me):

$ ls . | grep "35m"
35m.gitlab-ci.yml.sed
35mREADME-github.md.sed
35mREADME-gitlab.md.sed
35mcontributing-github.md.sed
35mcontributing-gitlab.md.sed

Is this expected/desirable?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant