Skip to content

Commit 8590312

Browse files
authored
Merge pull request #148 from legendu-net/dev
Merge dev into main
2 parents 05d62e5 + e71b9af commit 8590312

27 files changed

+74
-69
lines changed

.golangci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,11 @@ linters:
136136
disabled: true
137137
- name: unused-parameter
138138
- name: unused-receiver
139+
staticcheck:
140+
checks:
141+
- "all"
142+
- "-SA9003"
143+
139144

140145
exclusions:
141146
presets:

.idx/dev.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
fzf
1515
util-linux
1616
go
17+
golangci-lint
1718
uv
1819
dos2unix
1920
];

cmd/ai/pytorch.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@ func pytorch(cmd *cobra.Command, _ []string) {
2222
utils.RunCmd(command)
2323
}
2424
if utils.GetBoolFlag(cmd, "config") {
25-
// nothing to configure
2625
}
2726
if utils.GetBoolFlag(cmd, "uninstall") {
28-
// TODO
2927
}
3028
}
3129

cmd/bigdata/arrowdb.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@ func linkArrowDbProfileFromHost() {
1313
dstProfile := filepath.Join(utils.UserHomeDir(), ".arrowdb_profile")
1414
if utils.ExistsFile(srcProfile) {
1515
// inside a Docker container, link profile from host
16-
if utils.ExistsFile(dstProfile) {
17-
utils.RemoveAll(dstProfile)
18-
}
19-
utils.Symlink(srcProfile, dstProfile)
16+
utils.Symlink(srcProfile, dstProfile, false)
2017
}
2118
}
2219

cmd/data.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ import (
88
)
99

1010
// Pull data for icon from GitHub into ~/.config/icon-data.
11-
func data(cmd *cobra.Command, args []string) {
11+
func data(cmd *cobra.Command, _ []string) {
1212
dir := "~/.config/icon-data"
1313
if !utils.GetBoolFlag(cmd, "force") && utils.ExistsDir(dir+"/.git") {
1414
fmt.Println("Using existing data in ~/.config/icon-data.")
1515
return
1616
}
1717

18-
utils.BackupDir(dir, "")
18+
utils.Backup(dir, "")
1919
utils.MkdirAll(dir, 0o700)
2020

2121
command := utils.Format(`git clone {gitUrl} {dir} \

cmd/dev/git.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func installGitUi(cmd *cobra.Command) {
3636
}
3737

3838
func linkGitUiFiles(baseDir string) {
39-
utils.SymlinkIntoDir("~/.config/icon-data/git/gitui/key_bindings.ron", filepath.Join(baseDir, "gitui"))
39+
utils.SymlinkIntoDir("~/.config/icon-data/git/gitui/key_bindings.ron", filepath.Join(baseDir, "gitui"), true)
4040
}
4141

4242
func configGitUi(cmd *cobra.Command) {
@@ -124,7 +124,7 @@ func git(cmd *cobra.Command, args []string) {
124124
}
125125
if utils.GetBoolFlag(cmd, "config") {
126126
network.SshClient(cmd, args)
127-
utils.Symlink("~/.config/icon-data/git/gitconfig", "~/.gitconfig")
127+
utils.Symlink("~/.config/icon-data/git/gitconfig", "~/.gitconfig", true)
128128
configGitProxy(cmd)
129129
configGitUi(cmd)
130130
}

cmd/dev/golang.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func installGoPls(prefix string) {
6060
}
6161

6262
// Install and configure Golang.
63-
func golang(cmd *cobra.Command, args []string) {
63+
func golang(cmd *cobra.Command, _ []string) {
6464
prefix := utils.GetCommandPrefix(false, map[string]uint32{
6565
"/usr/local/go": unix.W_OK | unix.R_OK,
6666
"/usr/local": unix.W_OK | unix.R_OK,

cmd/dev/pytype.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
)
1212

1313
// Install and configure pytype.
14-
func pytype(cmd *cobra.Command, args []string) {
14+
func pytype(cmd *cobra.Command, _ []string) {
1515
if utils.GetBoolFlag(cmd, "install") {
1616
command := utils.Format("{pip_install} pytype", map[string]string{
1717
"pip_install": utils.BuildPipInstall(cmd),

cmd/dev/rust.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func installCargoBinstall() {
104104
}
105105

106106
// Install and configure Rust.
107-
func rust(cmd *cobra.Command, args []string) {
107+
func rust(cmd *cobra.Command, _ []string) {
108108
rustupHome := utils.GetStringFlag(cmd, "rustup-home")
109109
if rustupHome == "" {
110110
rustupHome = filepath.Join(utils.UserHomeDir(), ".rustup")

cmd/ide/neovim.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
)
99

1010
// Install and configure neovim.
11-
func neovim(cmd *cobra.Command, args []string) {
11+
func neovim(cmd *cobra.Command, _ []string) {
1212
Neovim(
1313
utils.GetBoolFlag(cmd, "install"),
1414
utils.GetBoolFlag(cmd, "config"),
@@ -58,8 +58,7 @@ func Neovim(install bool, config bool, uninstall bool, yes_s string) {
5858
}
5959
if config {
6060
dir := "~/.config/nvim"
61-
utils.BackupDir(dir, "")
62-
utils.Symlink("~/.config/icon-data/nvim", dir)
61+
utils.Symlink("~/.config/icon-data/nvim", dir, true)
6362
}
6463
if uninstall {
6564
switch runtime.GOOS {

0 commit comments

Comments
 (0)