mirror of
				https://github.com/sammy-ette/Hilbish
				synced 2025-08-10 02:52:03 +00:00 
			
		
		
		
	Compare commits
	
		
			10 Commits
		
	
	
		
			4a4cb3409f
			...
			dc53eef829
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					dc53eef829 | ||
| 
						 | 
					2f728de6a1 | ||
| 
						 | 
					4dc5ff60fd | ||
| 
						 | 
					a414c87e06 | ||
| 
						 | 
					b3db55708a | ||
| 
						 | 
					7d7ccb5c9b | ||
| 
						 | 
					ece5f92307 | ||
| 
						 | 
					0e4f552be2 | ||
| 
						 | 
					23902ea25c | ||
| 
						 | 
					a7f0457dab | 
							
								
								
									
										4
									
								
								.github/workflows/release.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								.github/workflows/release.yml
									
									
									
									
										vendored
									
									
								
							@ -31,10 +31,12 @@ jobs:
 | 
				
			|||||||
            goos: windows
 | 
					            goos: windows
 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
    - uses: actions/checkout@v2
 | 
					    - uses: actions/checkout@v2
 | 
				
			||||||
 | 
					      with:
 | 
				
			||||||
 | 
					        submodules: recursive
 | 
				
			||||||
    - uses: wangyoucao577/go-release-action@v1.25
 | 
					    - uses: wangyoucao577/go-release-action@v1.25
 | 
				
			||||||
      with:
 | 
					      with:
 | 
				
			||||||
        github_token: ${{ secrets.GITHUB_TOKEN }}
 | 
					        github_token: ${{ secrets.GITHUB_TOKEN }}
 | 
				
			||||||
        goos: ${{ matrix.goos }}
 | 
					        goos: ${{ matrix.goos }}
 | 
				
			||||||
        goarch: ${{ matrix.goarch }}
 | 
					        goarch: ${{ matrix.goarch }}
 | 
				
			||||||
        binary_name: hilbish
 | 
					        binary_name: hilbish
 | 
				
			||||||
        extra_files: LICENSE README.md CHANGELOG.md .hilbishrc.lua prelude docs emmyLuaDocs
 | 
					        extra_files: LICENSE README.md CHANGELOG.md .hilbishrc.lua prelude libs docs emmyLuaDocs
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										12
									
								
								CHANGELOG.md
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								CHANGELOG.md
									
									
									
									
									
								
							@ -1,5 +1,15 @@
 | 
				
			|||||||
# 🎀 Changelog
 | 
					# 🎀 Changelog
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## [1.0.4] - 2021-03-12
 | 
				
			||||||
 | 
					### Fixed
 | 
				
			||||||
 | 
					- Panic when history directory doesn't exist
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## [1.0.3] - 2021-03-12
 | 
				
			||||||
 | 
					### Fixed
 | 
				
			||||||
 | 
					- Removed duplicate executable suggestions
 | 
				
			||||||
 | 
					- User input is added to history now instead of what's ran by Hilbish
 | 
				
			||||||
 | 
					- Formatting issue with prompt on no input
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## [1.0.2] - 2021-03-06
 | 
					## [1.0.2] - 2021-03-06
 | 
				
			||||||
### Fixed
 | 
					### Fixed
 | 
				
			||||||
- Cases where Hilbish's history directory doesn't exist will no longer cause a panic
 | 
					- Cases where Hilbish's history directory doesn't exist will no longer cause a panic
 | 
				
			||||||
@ -382,6 +392,8 @@ This input for example will prompt for more input to complete:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
First "stable" release of Hilbish.
 | 
					First "stable" release of Hilbish.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[1.0.4]: https://github.com/Rosettea/Hilbish/compare/v1.0.3...v1.0.4
 | 
				
			||||||
 | 
					[1.0.3]: https://github.com/Rosettea/Hilbish/compare/v1.0.2...v1.0.3
 | 
				
			||||||
[1.0.2]: https://github.com/Rosettea/Hilbish/compare/v1.0.1...v1.0.2
 | 
					[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
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										13
									
								
								history.go
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								history.go
									
									
									
									
									
								
							@ -12,11 +12,16 @@ type fileHistory struct {
 | 
				
			|||||||
	f *os.File
 | 
						f *os.File
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func newFileHistory() (*fileHistory, error) {
 | 
					func newFileHistory() *fileHistory {
 | 
				
			||||||
 | 
						err := os.MkdirAll(defaultHistDir, 0755)
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							panic(err)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	data, err := os.ReadFile(defaultHistPath)
 | 
						data, err := os.ReadFile(defaultHistPath)
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		if !errors.Is(err, fs.ErrNotExist) {
 | 
							if !errors.Is(err, fs.ErrNotExist) {
 | 
				
			||||||
			return nil, err
 | 
								panic(err)
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -30,7 +35,7 @@ func newFileHistory() (*fileHistory, error) {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
	f, err := os.OpenFile(defaultHistPath, os.O_APPEND | os.O_WRONLY | os.O_CREATE, 0755)
 | 
						f, err := os.OpenFile(defaultHistPath, os.O_APPEND | os.O_WRONLY | os.O_CREATE, 0755)
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return nil, err
 | 
							panic(err)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	fh := &fileHistory{
 | 
						fh := &fileHistory{
 | 
				
			||||||
@ -38,7 +43,7 @@ func newFileHistory() (*fileHistory, error) {
 | 
				
			|||||||
		f: f,
 | 
							f: f,
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return fh, nil
 | 
						return fh
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (h *fileHistory) Write(line string) (int, error) {
 | 
					func (h *fileHistory) Write(line string) (int, error) {
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										10
									
								
								main.go
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								main.go
									
									
									
									
									
								
							@ -52,16 +52,18 @@ func main() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	if defaultConfDir == "" {
 | 
						if defaultConfDir == "" {
 | 
				
			||||||
		// we'll add *our* default if its empty (wont be if its changed comptime)
 | 
							// we'll add *our* default if its empty (wont be if its changed comptime)
 | 
				
			||||||
		defaultConfPath = filepath.Join(confDir, "hilbish", "init.lua")
 | 
							defaultConfDir = filepath.Join(confDir, "hilbish")
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		// else do ~ substitution
 | 
							// else do ~ substitution
 | 
				
			||||||
		defaultConfPath = filepath.Join(expandHome(defaultHistDir), "init.lua")
 | 
							defaultConfDir = expandHome(defaultHistDir)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						defaultConfPath = filepath.Join(defaultConfDir, "init.lua")
 | 
				
			||||||
	if defaultHistDir == "" {
 | 
						if defaultHistDir == "" {
 | 
				
			||||||
		defaultHistPath = filepath.Join(userDataDir, "hilbish", ".hilbish-history")
 | 
							defaultHistDir = filepath.Join(userDataDir, "hilbish")
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		defaultHistPath = filepath.Join(expandHome(defaultHistDir), ".hilbish-history")
 | 
							defaultHistDir = expandHome(defaultHistDir)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						defaultHistPath = filepath.Join(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")
 | 
				
			||||||
	setshflag := getopt.BoolLong("setshellenv", 'S', "Sets $SHELL to Hilbish's executed path")
 | 
						setshflag := getopt.BoolLong("setshellenv", 'S', "Sets $SHELL to Hilbish's executed path")
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										6
									
								
								rl.go
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								rl.go
									
									
									
									
									
								
							@ -20,11 +20,7 @@ func newLineReader(prompt string, noHist bool) *lineReader {
 | 
				
			|||||||
	// we don't mind hilbish.read rl instances having completion,
 | 
						// we don't mind hilbish.read rl instances having completion,
 | 
				
			||||||
	// but it cant have shared history
 | 
						// but it cant have shared history
 | 
				
			||||||
	if !noHist {
 | 
						if !noHist {
 | 
				
			||||||
		fh, err := newFileHistory()
 | 
							fileHist = newFileHistory()
 | 
				
			||||||
		fileHist = fh // go stupid
 | 
					 | 
				
			||||||
		if err != nil {
 | 
					 | 
				
			||||||
			panic(err)
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		rl.SetHistoryCtrlR("file", fileHist)
 | 
							rl.SetHistoryCtrlR("file", fileHist)
 | 
				
			||||||
		rl.HistoryAutoWrite = false
 | 
							rl.HistoryAutoWrite = false
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										2
									
								
								vars.go
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								vars.go
									
									
									
									
									
								
							@ -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.2"
 | 
						version = "v1.0.4"
 | 
				
			||||||
	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'"
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user