feat: aliases #5
10
aliases.txt
10
aliases.txt
@ -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
|
||||
|
@ -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]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user