util

package
v3.5.15 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 27, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddExecutePermission

func AddExecutePermission(filePath string) error

func CreateCacheDirectory

func CreateCacheDirectory(pathFunc GetDirFunc, dirName string) (string, string, string, string, error)

devcontainer.vim が使用するキャッシュディレクトリを作成し、返却する。

返却値: devcontainer.vim 用のキャッシュディレクトリ devcontainer.vim 用の実行バイナリ格納ディレクトリ devcontainer.vim のマージ済み設定ファイル格納ディレクトリ

func CreateConfigDirectory

func CreateConfigDirectory(pathFunc GetDirFunc, dirName string) (string, error)

devcontainer.vim が使用するコンフィグディレクトリを作成し、返却する。

func CreateConfigFileForDevcontainer

func CreateConfigFileForDevcontainer(configDirForDevcontainer string, workspaceFolder string, configFilePath string, additionalConfigFilePath string) (string, error)

configFilePath と additionalConfigFilePath の JSON をマージし、 devcontainer.vim のキャッシュディレクトリ内の設定ファイル格納ディレクトリへ格納する。 作成した devcontainer.json を格納しているディレクトリのパスを返却する。

func CreateFileWithContents

func CreateFileWithContents(file string, content string, permission fs.FileMode) error

func ExtractShellVariables

func ExtractShellVariables(str string) (string, error)

文字列中のシェル変数を展開して返却する

func GetConfigDir

func GetConfigDir(configDirForDevcontainer string, workspaceFolder string) string

devcontainer.vim 用の devcontainer.json 格納先ディレクトリを計算して返却する。 `<devcontainer.vim のキャッシュディレクトリ>/config/<workspaceFolder の絶対パスを md5 播種化した文字列>` のディレクトリを返却

func GetLatestReleaseFromGitHub

func GetLatestReleaseFromGitHub(owner string, repository string) (string, error)

*

  • ユーザー名、リポジトリ名から最新リリースタグ名を返却する。

func IsExists

func IsExists(filePath string) bool

func IsExistsCommand

func IsExistsCommand(command string) bool

command で指定したものへパスが通っているかを確認する。 パスが通っている場合 true を返却し、通っていない場合 false を返却する。

func IsWsl

func IsWsl() bool

WSL 上で動いているかを判定する

func NormalizeContainerArch added in v3.3.0

func NormalizeContainerArch(containerArch string) (string, error)

func OpenFileWithDefaultApp

func OpenFileWithDefaultApp(filePath string) error

関連付けられたアプリケーションで開く

func ParseJwcc

func ParseJwcc(jwccPath string) ([]byte, error)

JWCC を標準 JSON に変換し、 []byte として返却

func RemoveEmptyString added in v3.4.2

func RemoveEmptyString(input []string) []string

func StartForwarding added in v3.4.0

func StartForwarding(listenAddr, forwardAddr string) error

ポートフォワーディング開始

Types

type GetDirFunc

type GetDirFunc func() (string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL