Compare commits

...

3 Commits

Author SHA1 Message Date
TorchedSammy 3babf36c43
fix: remove newline from prompt 2022-03-06 22:23:38 -04:00
TorchedSammy b7478c3c1a
chore: prepare for v1.0.2 release 2022-03-06 21:48:24 -04:00
TorchedSammy 605574f262
fix: create directory for hist dir if it doesnt exist 2022-03-06 21:44:46 -04:00
4 changed files with 14 additions and 4 deletions

View File

@ -5,7 +5,7 @@ local ansikit = require 'ansikit'
local function doPrompt(fail, mode) local function doPrompt(fail, mode)
hilbish.prompt(lunacolors.format( hilbish.prompt(lunacolors.format(
'{blue}%u {cyan}%d\n' .. (fail and '{red}' or '{green}') .. '' '{blue}%u {cyan}%d ' .. (fail and '{red}' or '{green}') .. ''
)) ))
end end

View File

@ -1,5 +1,9 @@
# 🎀 Changelog # 🎀 Changelog
## [1.0.2] - 2021-03-06
### Fixed
- Cases where Hilbish's history directory doesn't exist will no longer cause a panic
## [1.0.1] - 2021-03-06 ## [1.0.1] - 2021-03-06
### Fixed ### Fixed
- Using `hilbish.appendPath` will no longer result in string spam (debugging thing left being) - Using `hilbish.appendPath` will no longer result in string spam (debugging thing left being)
@ -378,6 +382,7 @@ This input for example will prompt for more input to complete:
First "stable" release of Hilbish. First "stable" release of Hilbish.
[1.0.2]: https://github.com/Rosettea/Hilbish/compare/v1.0.1...v1.0.2
[1.0.1]: https://github.com/Rosettea/Hilbish/compare/v1.0.0...v1.0.1 [1.0.1]: https://github.com/Rosettea/Hilbish/compare/v1.0.0...v1.0.1
[1.0.0]: https://github.com/Rosettea/Hilbish/compare/v0.7.1...v1.0.0 [1.0.0]: https://github.com/Rosettea/Hilbish/compare/v0.7.1...v1.0.0
[0.7.1]: https://github.com/Rosettea/Hilbish/compare/v0.7.0...v0.7.1 [0.7.1]: https://github.com/Rosettea/Hilbish/compare/v0.7.0...v0.7.1

View File

@ -55,12 +55,12 @@ func main() {
defaultConfPath = filepath.Join(confDir, "hilbish", "init.lua") defaultConfPath = filepath.Join(confDir, "hilbish", "init.lua")
} else { } else {
// else do ~ substitution // else do ~ substitution
defaultConfPath = filepath.Join(strings.Replace(defaultConfDir, "~", homedir, 1), "init.lua") defaultConfPath = filepath.Join(expandHome(defaultHistDir), "init.lua")
} }
if defaultHistDir == "" { if defaultHistDir == "" {
defaultHistPath = filepath.Join(userDataDir, "hilbish", ".hilbish-history") defaultHistPath = filepath.Join(userDataDir, "hilbish", ".hilbish-history")
} else { } else {
defaultHistPath = filepath.Join(strings.Replace(defaultHistDir, "~", homedir, 1), ".hilbish-history") defaultHistPath = filepath.Join(expandHome(defaultHistDir), ".hilbish-history")
} }
helpflag := getopt.BoolLong("help", 'h', "Prints Hilbish flags") helpflag := getopt.BoolLong("help", 'h', "Prints Hilbish flags")
verflag := getopt.BoolLong("version", 'v', "Prints Hilbish version") verflag := getopt.BoolLong("version", 'v', "Prints Hilbish version")
@ -263,3 +263,8 @@ func handleHistory(cmd string) {
// TODO: load history again (history shared between sessions like this ye) // TODO: load history again (history shared between sessions like this ye)
} }
func expandHome(path string) string {
homedir := curuser.HomeDir
return strings.Replace(defaultHistDir, "~", homedir, 1)
}

View File

@ -2,7 +2,7 @@ package main
// String vars that are free to be changed at compile time // String vars that are free to be changed at compile time
var ( var (
version = "v1.0.1" version = "v1.0.2"
defaultConfDir = "" // ~ will be substituted for home, path for user's default config defaultConfDir = "" // ~ will be substituted for home, path for user's default config
defaultHistDir = "" defaultHistDir = ""
commonRequirePaths = "';./libs/?/init.lua;./?/init.lua;./?/?.lua'" commonRequirePaths = "';./libs/?/init.lua;./?/init.lua;./?/?.lua'"