feat: aliases #5

Merged
ange merged 3 commits from devel into prod 2025-04-05 10:17:05 +00:00
2 changed files with 11 additions and 11 deletions
Showing only changes of commit 2b5867840b - Show all commits

View File

@ -1,5 +1,5 @@
ssh /static/ssh
pgp /static/pgp.asc
termux.sh https://git.gmoker.com/ange/termux/raw/branch/main/install.sh
dotfiles.sh
archinstall.sh
ssh /static/ssh
pgp /static/pgp.asc
termux.sh https://git.gmoker.com/ange/termux/raw/branch/main/install.sh
dotfiles.sh https://git.gmoker.com/ange/.dotfiles
arch.sh https://git.gmoker.com/ange/arch

View File

@ -1,7 +1,6 @@
package main
import (
"bufio"
"log"
"os"
"strings"
@ -10,16 +9,17 @@ import (
var ALIASES map[string]string
func generateAliases() {
f, err := os.Open("aliases.txt")
f, err := os.ReadFile("aliases.txt")
if err != nil {
log.Fatal(err)
}
sc := bufio.NewScanner(f)
ALIASES = make(map[string]string)
for sc.Scan() {
sp := strings.Fields(sc.Text())
for l := range strings.SplitSeq(string(f), "\n") {
sp := strings.Fields(l)
ALIASES[sp[0]] = sp[1]
if len(sp) == 2 {
ALIASES[sp[0]] = sp[1]
}
}
}