mirror of
https://github.com/ddworken/hishtory.git
synced 2025-08-14 17:18:46 +02:00
Improve backup and restore env function + fix makefile with quotes + remove the zdotdir created file
This commit is contained in:
@ -150,7 +150,11 @@ func copy(src, dst string) error {
|
||||
func BackupAndRestoreEnv(k string) func() {
|
||||
origValue := os.Getenv(k)
|
||||
return func() {
|
||||
os.Setenv(k, origValue)
|
||||
if origValue == "" {
|
||||
os.Unsetenv(k)
|
||||
} else {
|
||||
os.Setenv(k, origValue)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user