mirror of
				https://github.com/sammy-ette/Hilbish
				synced 2025-08-10 02:52:03 +00:00 
			
		
		
		
	Compare commits
	
		
			No commits in common. "95391d74f6b2717264e57f17dfa580a890716704" and "762066022da74d307b958acda57e60a128b75f0d" have entirely different histories.
		
	
	
		
			95391d74f6
			...
			762066022d
		
	
		
@ -25,7 +25,6 @@ local function doNotifyPrompt()
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
doPrompt()
 | 
			
		||||
--[[
 | 
			
		||||
 | 
			
		||||
bait.catch('command.preexec', function()
 | 
			
		||||
	running = true
 | 
			
		||||
@ -48,4 +47,3 @@ end)
 | 
			
		||||
bait.catch('hilbish.notification', function(notif)
 | 
			
		||||
	doNotifyPrompt()
 | 
			
		||||
end)
 | 
			
		||||
]]--
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										9
									
								
								api.go
									
									
									
									
									
								
							
							
						
						
									
										9
									
								
								api.go
									
									
									
									
									
								
							@ -51,9 +51,7 @@ func hilbishLoader(mlr *moonlight.Runtime) moonlight.Value {
 | 
			
		||||
		"hinter": {hlhinter, 1, false},
 | 
			
		||||
		"multiprompt": {hlmultiprompt, 1, false},
 | 
			
		||||
		"prependPath": {hlprependPath, 1, false},
 | 
			
		||||
		*/
 | 
			
		||||
		"prompt": {hlprompt, 1, true},
 | 
			
		||||
		/*
 | 
			
		||||
		"inputMode": {hlinputMode, 1, false},
 | 
			
		||||
		"interval": {hlinterval, 2, false},
 | 
			
		||||
		"read": {hlread, 1, false},
 | 
			
		||||
@ -82,7 +80,6 @@ func hilbishLoader(mlr *moonlight.Runtime) moonlight.Value {
 | 
			
		||||
	hshMod.SetField("interactive", moonlight.BoolValue(interactive))
 | 
			
		||||
	hshMod.SetField("login", moonlight.BoolValue(login))
 | 
			
		||||
	hshMod.SetField("exitCode", moonlight.IntValue(0))
 | 
			
		||||
	hshMod.SetField("midnightEdition", moonlight.BoolValue(moonlight.IsMidnight()))
 | 
			
		||||
	//util.SetField(rtm, mod, "vimMode", rt.NilValue)
 | 
			
		||||
 | 
			
		||||
	// hilbish.userDir table
 | 
			
		||||
@ -133,10 +130,8 @@ func hilbishLoader(mlr *moonlight.Runtime) moonlight.Value {
 | 
			
		||||
	//mod.Set(rt.StringValue("version"), rt.TableValue(versionModule))
 | 
			
		||||
 | 
			
		||||
	// very meta
 | 
			
		||||
	if moonlight.IsMidnight() {
 | 
			
		||||
		moduleModule := moduleLoader(mlr)
 | 
			
		||||
		hshMod.SetField("module", moonlight.TableValue(moduleModule))
 | 
			
		||||
	}
 | 
			
		||||
	//moduleModule := moduleLoader(mlr)
 | 
			
		||||
	//hshMod.SetField("module", moonlight.TableValue(moduleModule))
 | 
			
		||||
 | 
			
		||||
	return moonlight.TableValue(hshMod)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										3
									
								
								main.go
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								main.go
									
									
									
									
									
								
							@ -339,9 +339,6 @@ func getVersion() string {
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	v.WriteString(" (" + releaseName + ")")
 | 
			
		||||
	if moonlight.IsMidnight() {
 | 
			
		||||
		v.WriteString(" (Midnight Edition)")
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	return v.String()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -1,6 +0,0 @@
 | 
			
		||||
//go:build midnight
 | 
			
		||||
package moonlight
 | 
			
		||||
 | 
			
		||||
func IsMidnight() bool {
 | 
			
		||||
	return true
 | 
			
		||||
}
 | 
			
		||||
@ -1,6 +0,0 @@
 | 
			
		||||
//go:build !midnight
 | 
			
		||||
package moonlight
 | 
			
		||||
 | 
			
		||||
func IsMidnight() bool {
 | 
			
		||||
	return false
 | 
			
		||||
}
 | 
			
		||||
@ -41,7 +41,7 @@ func TableValue(t *Table) Value {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func FunctionValue(f Callable) Value {
 | 
			
		||||
	return Value{iface: f}
 | 
			
		||||
	return NilValue
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func AsValue(i interface{}) Value {
 | 
			
		||||
 | 
			
		||||
@ -1,25 +1,22 @@
 | 
			
		||||
-- Prelude initializes everything else for our shell
 | 
			
		||||
--[[
 | 
			
		||||
local _ = require 'succulent' -- Function additions
 | 
			
		||||
local bait = require 'bait'
 | 
			
		||||
--local fs = require 'fs'
 | 
			
		||||
local fs = require 'fs'
 | 
			
		||||
 | 
			
		||||
package.path = package.path .. ';' .. hilbish.dataDir .. '/?/init.lua'
 | 
			
		||||
.. ';' .. hilbish.dataDir .. '/?/?.lua' .. ";" .. hilbish.dataDir .. '/?.lua'
 | 
			
		||||
 | 
			
		||||
if not hilbish.midnightEdition then
 | 
			
		||||
	hilbish.module.paths = '?.so;?/?.so;'
 | 
			
		||||
	.. hilbish.userDir.data .. 'hilbish/libs/?/?.so'
 | 
			
		||||
	.. ";" .. hilbish.userDir.data .. 'hilbish/libs/?.so'
 | 
			
		||||
hilbish.module.paths = '?.so;?/?.so;'
 | 
			
		||||
.. hilbish.userDir.data .. 'hilbish/libs/?/?.so'
 | 
			
		||||
.. ";" .. hilbish.userDir.data .. 'hilbish/libs/?.so'
 | 
			
		||||
 | 
			
		||||
	table.insert(package.searchers, function(module)
 | 
			
		||||
table.insert(package.searchers, function(module)
 | 
			
		||||
	local path = package.searchpath(module, hilbish.module.paths)
 | 
			
		||||
	if not path then return nil end
 | 
			
		||||
 | 
			
		||||
	-- it didnt work normally, idk
 | 
			
		||||
	return function() return hilbish.module.load(path) end, path
 | 
			
		||||
	end)
 | 
			
		||||
end
 | 
			
		||||
end)
 | 
			
		||||
 | 
			
		||||
require 'nature.commands'
 | 
			
		||||
require 'nature.completions'
 | 
			
		||||
@ -93,4 +90,3 @@ end)
 | 
			
		||||
bait.catch('command.not-executable', function(cmd)
 | 
			
		||||
	print(string.format('hilbish: %s: not executable', cmd))
 | 
			
		||||
end)
 | 
			
		||||
]]--
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user