Skip to content

Commit

Permalink
Fix fkeys in keybindings, make outputFile better for windows+WSL use (#…
Browse files Browse the repository at this point in the history
…21)

* Change path used in outputFile to be relative, not full.
* Fix function keys in keybindings
* Adjust CI bridge to use relative pathing in the mpackage so that it works better in windows with WSL or docker
  • Loading branch information
demonnic committed Aug 21, 2021
1 parent 2ea74fa commit 1c4a714
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 28 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ plugins {
id 'com.github.johnrengelman.shadow' version '5.0.0'

}
version = '0.8'
version = '0.9'
mainClassName = "muddler.App"

repositories {
Expand Down
2 changes: 1 addition & 1 deletion mpackage/mfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"package": "Muddler",
"version": "1.0.0",
"version": "1.0.1",
"author": "Demonnic",
"description": "A helper package for reloading packages created by muddler automatically",
"title": "muddler helper package"
Expand Down
11 changes: 5 additions & 6 deletions mpackage/src/scripts/muddler/code.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ function Muddler:new(options)
setmetatable(me, self)
self.__index = self
me.path = me.path:gsub("\\", "/")
me.path = me.path .. "/.output"
if me.watch then me:start() end
return me
end
Expand All @@ -22,11 +21,11 @@ function Muddler:start()
self:stop()
self.watch = true
self.eventHandler = registerAnonymousEventHandler("sysPathChanged", function(_, path)
if path == self.path then
if path == self.path .. "/.output" then
self:reload()
end
end)
addFileWatch(self.path)
addFileWatch(self.path .. "/.output")
end

local function jsonload(file)
Expand All @@ -42,7 +41,7 @@ function Muddler:stop()
killAnonymousEventHandler(self.eventHandler)
self.eventHandler = nil
end
removeFileWatch(self.path)
removeFileWatch(self.path .. "/.output")
end

local function execute(item)
Expand Down Expand Up @@ -73,7 +72,7 @@ local function execute(item)
end

function Muddler:reload()
local ok, pkgInfo = pcall(jsonload, self.path)
local ok, pkgInfo = pcall(jsonload, self.path .. "/.output")
if not ok then
debugc("Error loading output file, err: " .. pkgInfo)
return
Expand All @@ -82,7 +81,7 @@ function Muddler:reload()
return
end
local name = pkgInfo.name
local path = pkgInfo.path
local path = self.path .. pkgInfo.path
local prer, postr, prei, posti = self.preremove, self.postremove, self.preinstall, self.postinstall
debugc("preremove " .. name)
if prer then
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>muddler</groupId>
<artifactId>muddler</artifactId>
<version>0.8</version>
<version>0.9</version>
<inceptionYear>2019</inceptionYear>
<dependencies>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion src/main/groovy/muddler/App.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class App {
if (outputFile) {
def cwd = System.properties['user.dir']
def outFile = new File('./.output')
def line = "{ \"name\": \"$packageName\", \"path\": \"${cwd + File.separator + mpackageFilename}\" }\n"
def line = "{ \"name\": \"$packageName\", \"path\": \"/$mpackageFilename\" }\n"
outFile.newWriter().withWriter { w ->
w << line
}
Expand Down
36 changes: 18 additions & 18 deletions src/main/groovy/muddler/mudlet/items/Key.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -180,24 +180,24 @@ def generateModifierCode(ArrayList modifiers) {
'caps': '16777252',
'num': '16777253',
'scroll': '16777254',
'F1': '16777264',
'F2': '16777265',
'F3': '16777266',
'F4': '16777267',
'F5': '16777268',
'F6': '16777269',
'F7': '16777270',
'F8': '16777271',
'F9': '16777272',
'F10': '16777273',
'F11': '16777274',
'F12': '16777275',
'F13': '16777276',
'F14': '16777277',
'F15': '16777278',
'F16': '16777279',
'F17': '16777280',
'F18': '16777281',
'f1': '16777264',
'f2': '16777265',
'f3': '16777266',
'f4': '16777267',
'f5': '16777268',
'f6': '16777269',
'f7': '16777270',
'f8': '16777271',
'f9': '16777272',
'f10': '16777273',
'f11': '16777274',
'f12': '16777275',
'f13': '16777276',
'f14': '16777277',
'f15': '16777278',
'f16': '16777279',
'f17': '16777280',
'f18': '16777281',
'!': '33',
'"': '34',
'#': '35',
Expand Down

0 comments on commit 1c4a714

Please sign in to comment.