commit a2bdd44
chld
·
2026-02-07 23:12:02 +0000 UTC
parent 26cedce
less permissiveness
1 files changed,
+6,
-3
+6,
-3
1@@ -41,9 +41,12 @@ func Inst(pkg string) {
2 */
3 // write the installed package to a installed file for tracking
4 fx, _ := os.ReadFile(filepath.Join(os.Getenv("DTR_DB"), "installed"))
5- if strings.Contains(string(fx), pkg) {
6- dgr.Msg("reinstalled \033[1;32m", pkg, "\033[m successfully")
7- return // we already see the package installed, no need to write again so exit now
8+ fxx := strings.Fields(string(fx))
9+ for i := range len(fxx) {
10+ if fxx[i] == pkg {
11+ dgr.Msg("reinstalled \033[1;32m", pkg, "\033[m successfully")
12+ return
13+ }
14 }
15
16 f, err := os.OpenFile(