ref: move files to dedicated res folder

This commit is contained in:
relikd
2026-01-28 12:44:43 +01:00
parent 1af81e5b4a
commit b6eaa8d3c4
17 changed files with 7 additions and 8 deletions

View File

@@ -11,7 +11,7 @@ HAS_SIGN_IDENTITY=$(shell security find-identity -v -p codesigning | grep -q "Ap
Menuscript.app: SDK_PATH=$(shell xcrun --show-sdk-path --sdk macosx) Menuscript.app: SDK_PATH=$(shell xcrun --show-sdk-path --sdk macosx)
Menuscript.app: src/* examples/* Menuscript.app: src/* res/**
@mkdir -p Menuscript.app/Contents/MacOS/ @mkdir -p Menuscript.app/Contents/MacOS/
swiftc ${CFLAGS} src/main.swift -target x86_64-apple-macos10.13 \ swiftc ${CFLAGS} src/main.swift -target x86_64-apple-macos10.13 \
-emit-executable -sdk ${SDK_PATH} -o bin_x64 -emit-executable -sdk ${SDK_PATH} -o bin_x64
@@ -20,11 +20,10 @@ Menuscript.app: src/* examples/*
lipo -create bin_x64 bin_arm64 -o Menuscript.app/Contents/MacOS/Menuscript lipo -create bin_x64 bin_arm64 -o Menuscript.app/Contents/MacOS/Menuscript
@rm bin_x64 bin_arm64 @rm bin_x64 bin_arm64
@echo 'APPL????' > Menuscript.app/Contents/PkgInfo @echo 'APPL????' > Menuscript.app/Contents/PkgInfo
@mkdir -p Menuscript.app/Contents/Resources/
@cp src/AppIcon.icns Menuscript.app/Contents/Resources/AppIcon.icns
@rm -rf Menuscript.app/Contents/Resources/examples/
@cp -R examples/ Menuscript.app/Contents/Resources/examples/
@cp src/Info.plist Menuscript.app/Contents/Info.plist @cp src/Info.plist Menuscript.app/Contents/Info.plist
@find res -name .DS_Store -delete
@rm -rf Menuscript.app/Contents/Resources/
@cp -R res/ Menuscript.app/Contents/Resources/
@touch Menuscript.app @touch Menuscript.app
@echo @echo
ifeq ($(HAS_SIGN_IDENTITY),1) ifeq ($(HAS_SIGN_IDENTITY),1)

View File

@@ -12,7 +12,7 @@ A menu bar script executor.
Menuscript adds a status bar menu to call custom (user defined) scripts. Menuscript adds a status bar menu to call custom (user defined) scripts.
The app reads the content of a directory and adds all executable files to the status menu. The app reads the content of a directory and adds all executable files to the status menu.
The screenshot above represents the content of the [examples](examples/) directory. The screenshot above represents the content of the [res/examples](res/examples/) directory.
## Usage ## Usage

View File

Before

Width:  |  Height:  |  Size: 214 B

After

Width:  |  Height:  |  Size: 214 B

View File

@@ -72,7 +72,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSMenuDelegate {
// if run via .app bundle // if run via .app bundle
return Bundle.main.url(forResource: name, withExtension: ext) return Bundle.main.url(forResource: name, withExtension: ext)
// if calling swift directly // if calling swift directly
?? URL(fileURLWithPath: #file + "/../../" + name + (ext == nil ? "" : ("." + ext!))) ?? URL(fileURLWithPath: #file + "/../../res/" + name + (ext == nil ? "" : ("." + ext!)))
} }
// MARK: - Manage storage path // MARK: - Manage storage path
@@ -268,7 +268,7 @@ struct Entry {
} }
} }
extension Entry : Comparable { extension Entry: Comparable {
static func < (lhs: Entry, rhs: Entry) -> Bool { static func < (lhs: Entry, rhs: Entry) -> Bool {
return (lhs.order, lhs.title) < (rhs.order, rhs.title) return (lhs.order, lhs.title) < (rhs.order, rhs.title)
} }