mirror of
				https://github.com/sammy-ette/Hilbish
				synced 2025-08-10 02:52:03 +00:00 
			
		
		
		
	Compare commits
	
		
			2 Commits
		
	
	
		
			1eed4cc7ee
			...
			959030f70d
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | 959030f70d | ||
|  | 59cec0ffa5 | 
| @ -1,8 +1,19 @@ | |||||||
| -- Add command builtins | local fs = require 'fs' | ||||||
| require 'nature.commands.cd' | 
 | ||||||
| require 'nature.commands.cdr' | -- explanation: this specific function gives to us info about | ||||||
| require 'nature.commands.doc' | -- the currently running source. this includes a path to the | ||||||
| require 'nature.commands.exit' | -- source file (info.source) | ||||||
| require 'nature.commands.disown' | -- we will use that to automatically load all commands by reading | ||||||
| require 'nature.commands.fg' | -- all the files in this dir and just requiring it. | ||||||
| require 'nature.commands.bg' | local info = debug.getinfo(1) | ||||||
|  | local commandDir = fs.dir(info.source) | ||||||
|  | if commandDir == '.' then return end | ||||||
|  | 
 | ||||||
|  | local commands = fs.readdir(commandDir) | ||||||
|  | for _, command in ipairs(commands) do | ||||||
|  | 	local name = command:gsub('%.lua', '') -- chop off extension | ||||||
|  | 	if name ~= 'init' then | ||||||
|  | 		-- skip this file (for obvious reasons) | ||||||
|  | 		require('nature.commands.' .. name) | ||||||
|  | 	end | ||||||
|  | end | ||||||
|  | |||||||
							
								
								
									
										2
									
								
								rl.go
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								rl.go
									
									
									
									
									
								
							| @ -55,7 +55,7 @@ func newLineReader(prompt string, noHist bool) *lineReader { | |||||||
| 			return []rune{} | 			return []rune{} | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
| 		retVal, err := rt.Call1(l.MainThread(), rt.FunctionValue(highlighter), | 		retVal, err := rt.Call1(l.MainThread(), rt.FunctionValue(hinter), | ||||||
| 		rt.StringValue(string(line)), rt.IntValue(int64(pos))) | 		rt.StringValue(string(line)), rt.IntValue(int64(pos))) | ||||||
| 		if err != nil { | 		if err != nil { | ||||||
| 			fmt.Println(err) | 			fmt.Println(err) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user