Skip to content

Commit

Permalink
Use system arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
javalikescript committed Apr 1, 2024
1 parent e13052c commit c934ca4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ ZIP := $(ZIP_$(PLAT))

RELEASE_FILES ?= fcut$(EXE) README.md licenses.txt

LUAJLS=luajls
STATIC_FLAGS_windows=lua/src/wlua.res -mwindows
STATIC_FLAGS_linux=

Expand All @@ -44,16 +45,15 @@ licenses:
cp -u $(LUACLIBS)/licenses.txt .

bin:
$(MAKE) -C $(LUACLIBS) OPENSSL_LIBNAMES= OPENSSL_LIBS= \
$(MAKE) -C $(LUACLIBS) STATIC_OPENSSL= \
STATIC_RESOURCES="-R $(FCUT_REL)/assets $(FCUT_REL)/htdocs -l $(FCUT_REL)/fcut.lua $(FCUT_REL)/fcutSchema.lua $(FCUT_REL)/Ffmpeg.lua $(FCUT_REL)/FileChooser.lua" \
LUAJLS=luajls "STATIC_EXECUTE=require('fcut')" \
STATIC_FLAGS="$(STATIC_FLAGS_$(PLAT))" static-full
mv $(LUACLIBS)/dist/luajls$(EXE) fcut$(EXE)
LUAJLS=$(LUAJLS) STATIC_FLAGS="$(STATIC_FLAGS_$(PLAT))" STATIC_EXECUTE="require('fcut')" STATIC_NAME=fcut static-full
mv $(LUACLIBS)/dist/fcut$(EXE) .

release.tar.gz:
-rm fcut$(RELEASE_NAME).tar.gz
-rm -f fcut$(RELEASE_NAME).tar.gz
tar --group=jls --owner=jls -zcvf fcut$(RELEASE_NAME).tar.gz $(RELEASE_FILES)

release.zip:
-rm fcut$(RELEASE_NAME).zip
-rm -f fcut$(RELEASE_NAME).zip
zip -r fcut$(RELEASE_NAME).zip $(RELEASE_FILES)
5 changes: 1 addition & 4 deletions fcut.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ local HttpExchange = require('jls.net.http.HttpExchange')
local ResourceHttpHandler = require('jls.net.http.handler.ResourceHttpHandler')
local FileHttpHandler = require('jls.net.http.handler.FileHttpHandler')
local RestHttpHandler = require('jls.net.http.handler.RestHttpHandler')
local ZipFileHttpHandler = require('jls.net.http.handler.ZipFileHttpHandler')
local TableHttpHandler = require('jls.net.http.handler.TableHttpHandler')
local WebSocketUpgradeHandler = require('jls.net.http.WebSocket').UpgradeHandler

Expand Down Expand Up @@ -82,7 +81,7 @@ local function startProcess(command, outputFile, callback)
end

-- Extracts configuration from command line arguments
local config = tables.createArgumentTable(arg, {
local config = system.createArgumentTable({
helpPath = 'help',
configPath = 'config',
emptyPath = 'config',
Expand All @@ -109,8 +108,6 @@ end

local scriptFile = File:new(arg[0]):getAbsoluteFile()
local scriptDir = scriptFile:getParentFile()
local assetsDir = File:new(scriptDir, 'assets')
local assetsZip = File:new(scriptDir, 'assets.zip')
local extensionsDir = File:new(scriptDir, config.extensions)

local commandQueue = {}
Expand Down

0 comments on commit c934ca4

Please sign in to comment.