Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 30, 2024. It is now read-only.
/coder-v1-cliPublic archive

fix: Force bash for non-standard flags to exec#226

Merged
jawnsy merged 1 commit intomasterfromjawnsy/ch418
Jan 25, 2021
Merged
Changes fromall commits
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
13 changes: 9 additions & 4 deletionsinternal/cmd/shell.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -82,15 +82,20 @@ coder sh front-end-dev cat ~/config.json`,

func shell(cmd *cobra.Command, cmdArgs []string) error {
ctx := cmd.Context()
command:= "sh"
args:=[]string{"-c"}
varcommandstring
varargs []string
if len(cmdArgs) > 1 {
command = "/bin/sh"
args = []string{"-c"}
args = append(args, strings.Join(cmdArgs[1:], " "))
} else {
// Bring user into shell if no command is specified.
shell := "$(getent passwd $(id -u) | cut -d: -f 7)"
name := "-$(basename " + shell + ")"
args = append(args, fmt.Sprintf("exec -a %q %q", name, shell))

// force bash for the '-l' flag to the exec built-in
command = "/bin/bash"
args = []string{"-c"}
args = append(args, fmt.Sprintf("exec -l %q", shell))
}

envName := cmdArgs[0]
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp