Skip to content

feat(cli): check if dotfiles install script is executable #8588

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

Merged
merged 15 commits into from
Jul 21, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
make dotfiles install scripts executable
  • Loading branch information
BRAVO68WEB committed Jul 19, 2023
commit 1d9c0f051872675a6d8a577ee2227aedc79eb8ba
7 changes: 7 additions & 0 deletions cli/dotfiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,13 @@ func (r *RootCmd) dotfiles() *clibase.Cmd {
// it is safe to use a variable command here because it's from
// a filtered list of pre-approved install scripts
// nolint:gosec

// making selected script executable
err = os.Chmod(filepath.Join(dotfilesDir, script), 0o755)
if err != nil {
return xerrors.Errorf("chmod %s: %w", script, err)
}

scriptCmd := exec.CommandContext(inv.Context(), filepath.Join(dotfilesDir, script))
scriptCmd.Dir = dotfilesDir
scriptCmd.Stdout = inv.Stdout
Expand Down