Skip to content

chore: propose coder dotfiles command #1696

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

Closed
wants to merge 8 commits into from
Closed
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
Prev Previous commit
Next Next commit
fix lint
  • Loading branch information
f0ssel committed May 24, 2022
commit 2cf43d6f4154e8ad8360f47ac4db3d2b8cd681fe
6 changes: 5 additions & 1 deletion cli/dotfiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ import (
"path/filepath"
"strings"

"github.com/coder/coder/cli/cliui"
"github.com/spf13/cobra"
"golang.org/x/xerrors"

"github.com/coder/coder/cli/cliui"
)

func dotfiles() *cobra.Command {
Expand Down Expand Up @@ -123,6 +124,9 @@ func dotfiles() *cobra.Command {

for _, s := range scripts {
_, _ = fmt.Fprint(cmd.OutOrStdout(), fmt.Sprintf("\nRunning %s...\n", s))
// it is safe to use a variable command here because it's from
// a filtered list of pre-approved install scripts
// nolint:gosec
c := exec.CommandContext(cmd.Context(), fmt.Sprintf("./%s", s))
c.Dir = dotfilesDir
out, err := c.CombinedOutput()
Expand Down