-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from mikoto2000/support-mac
Apple Silicon 系 macOS 対応を追加。
- Loading branch information
Showing
16 changed files
with
240 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
//go:build darwin && arm64 | ||
|
||
package devcontainer | ||
|
||
func DockerVimArgs(containerID string, workspaceFolder string, vimFileName string) []string { | ||
return []string{ | ||
"exec", | ||
"--container-id", | ||
containerID, | ||
"--workspace-folder", | ||
workspaceFolder, | ||
"sh", | ||
"-c", | ||
"cd /; tar zxf ./" + vimFileName + " -C ~/ > /dev/null; cd ~; sudo rm -rf ~/vim-static; mv $(ls -d ~/vim-*-aarch64) ~/vim-static;~/vim-static/AppRun --cmd \"let g:devcontainer_vim = v:true\" -S /SendToTcp.vim -S /vimrc"} | ||
|
||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
//go:build linux && amd64 | ||
|
||
package devcontainer | ||
|
||
func DockerVimArgs(containerID string, workspaceFolder string, vimFileName string) []string { | ||
return []string{ | ||
"exec", | ||
"--container-id", | ||
containerID, | ||
"--workspace-folder", | ||
workspaceFolder, | ||
"sh", | ||
"-c", | ||
"cd ~; /" + vimFileName + " --appimage-extract > /dev/null; cd -; ~/squashfs-root/AppRun --cmd \"let g:devcontainer_vim = v:true\" -S /SendToTcp.vim -S /vimrc"} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
//go:build windows && amd64 | ||
|
||
package devcontainer | ||
|
||
func DockerVimArgs(containerID string, workspaceFolder string, vimFileName string) []string { | ||
return []string{ | ||
"exec", | ||
"--container-id", | ||
containerID, | ||
"--workspace-folder", | ||
workspaceFolder, | ||
"sh", | ||
"-c", | ||
"cd ~; /" + vimFileName + " --appimage-extract > /dev/null; cd -; ~/squashfs-root/AppRun --cmd \"let g:devcontainer_vim = v:true\" -S /SendToTcp.vim -S /vimrc"} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
//go:build darwin | ||
|
||
package tools | ||
|
||
const devcontainerFileName = "devcontainer" | ||
|
||
// devcontainer-cli のダウンロード URL | ||
const downloadURLDevcontainersCliPattern = "https://github.com/mikoto2000/devcontainers-cli/releases/download/{{ .TagName }}/devcontainer-darwin-arm64-{{ .TagName }}" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
//go:build !windows | ||
//go:build linux | ||
|
||
package tools | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
//go:build darwin | ||
|
||
package tools | ||
|
||
import ( | ||
"strings" | ||
"text/template" | ||
|
||
"github.com/mikoto2000/devcontainer.vim/util" | ||
) | ||
|
||
// Vim のダウンロード URL | ||
const vimDownloadURLPattern = "https://github.com/mikoto2000/vim-static/releases/download/{{ .TagName }}/vim-{{ .TagName }}-aarch64.tar.gz" | ||
|
||
// Vim のツール情報 | ||
var VIM Tool = Tool{ | ||
FileName: "vim", | ||
CalculateDownloadURL: func() string { | ||
latestTagName, err := util.GetLatestReleaseFromGitHub("mikoto2000", "vim-static") | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
pattern := "pattern" | ||
tmpl, err := template.New(pattern).Parse(vimDownloadURLPattern) | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
tmplParams := map[string]string{"TagName": latestTagName} | ||
var downloadURL strings.Builder | ||
err = tmpl.Execute(&downloadURL, tmplParams) | ||
if err != nil { | ||
panic(err) | ||
} | ||
return downloadURL.String() | ||
}, | ||
installFunc: func(downloadURL string, filePath string) (string, error) { | ||
_, err := simpleInstall(downloadURL, filePath) | ||
if err != nil { | ||
return "", err | ||
} | ||
|
||
// TODO, tar.gz を展開 | ||
//err = util.ExtractTarGz(filePath + ".tar.gz" ,filePath) | ||
//if err != nil { | ||
// return "", err | ||
//} | ||
return filePath, nil | ||
|
||
}, | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
//go:build linux && amd64 | ||
|
||
package tools | ||
|
||
import ( | ||
"strings" | ||
"text/template" | ||
|
||
"github.com/mikoto2000/devcontainer.vim/util" | ||
) | ||
|
||
// Vim のダウンロード URL | ||
const vimDownloadURLPattern = "https://github.com/vim/vim-appimage/releases/download/{{ .TagName }}/Vim-{{ .TagName }}.glibc2.29-x86_64.AppImage" | ||
|
||
// Vim のツール情報 | ||
var VIM Tool = Tool{ | ||
FileName: "vim", | ||
CalculateDownloadURL: func() string { | ||
latestTagName, err := util.GetLatestReleaseFromGitHub("vim", "vim-appimage") | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
pattern := "pattern" | ||
tmpl, err := template.New(pattern).Parse(vimDownloadURLPattern) | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
tmplParams := map[string]string{"TagName": latestTagName} | ||
var downloadURL strings.Builder | ||
err = tmpl.Execute(&downloadURL, tmplParams) | ||
if err != nil { | ||
panic(err) | ||
} | ||
return downloadURL.String() | ||
}, | ||
installFunc: func(downloadURL string, filePath string) (string, error) { | ||
return simpleInstall(downloadURL, filePath) | ||
}, | ||
} | ||
|
||
|
Oops, something went wrong.