Skip to content

Commit

Permalink
コンテナの起動時間が長いと展開した Vim が削除される問題を修正。
Browse files Browse the repository at this point in the history
展開先をホームディレクトリに変更。
  • Loading branch information
mikoto2000 committed Jun 13, 2024
1 parent 10c185e commit 9a75fc1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
10 changes: 9 additions & 1 deletion devcontainer/devcontainer.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,15 @@ func ExecuteDevcontainer(args []string, devcontainerPath string, vimFilePath str
ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt)
defer cancel()

dockerVimArgs := []string{"exec", "--container-id", containerId, "--workspace-folder", workspaceFolder, "/" + vimFileName, "--appimage-extract-and-run", "-S", "/SendToTcp.vim", "-S", "/vimrc"}
dockerVimArgs := []string{
"exec",
"--container-id",
containerId,
"--workspace-folder",
workspaceFolder,
"sh",
"-c",
"/" + vimFileName + "--appimage-extract; ./squashfs-root/AppRun -S /SendToTcp.vim -S /vimrc"}
fmt.Printf("Start vim: `%s \"%s\"`\n", devcontainerPath, strings.Join(dockerVimArgs, "\" \""))
dockerExec := exec.CommandContext(ctx, devcontainerPath, dockerVimArgs...)
dockerExec.Stdin = os.Stdin
Expand Down
9 changes: 8 additions & 1 deletion docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,14 @@ func Run(args []string, vimFilePath string, cdrPath string, configDirForDocker s
ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt)
defer cancel()

dockerVimArgs := []string{"exec", "-it", containerId, "/" + vimFileName, "--appimage-extract-and-run", "-S", "/SendToTcp.vim", "-S", "/vimrc"}
dockerVimArgs := []string{
"exec",
"-it",
containerId,
"sh",
"-c",
"/" + vimFileName + " --appimage-extract; ./squashfs-root/AppRun -S /SendToTcp.vim -S /vimrc",
}
fmt.Printf("Start vim: `%s \"%s\"`\n", CONTAINER_COMMAND, strings.Join(dockerVimArgs, "\" \""))
dockerExec := exec.CommandContext(ctx, CONTAINER_COMMAND, dockerVimArgs...)
dockerExec.Stdin = os.Stdin
Expand Down

0 comments on commit 9a75fc1

Please sign in to comment.