util

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 13 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 added in v0.8.0

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

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

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

func CreateConfigDirectory added in v0.8.0

func CreateConfigDirectory(pathFunc GetDirFunc, dirName string) string

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

func CreateConfigFileForDevcontainer added in v0.8.0

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

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

func CreateFileWithContents added in v0.9.0

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

func ExtractShellVariables added in v0.9.0

func ExtractShellVariables(str string) (string, error)

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

func GetConfigDir added in v0.5.0

func GetConfigDir(configDirForDevcontainer string, workspaceFolder string) string

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

func GetLatestReleaseFromGitHub added in v0.7.0

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 added in v0.8.0

func IsWsl() bool

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

func OpenFileWithDefaultApp added in v0.8.0

func OpenFileWithDefaultApp(filePath string) error

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

func ParseJwcc added in v1.0.2

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

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

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