Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a7629a6e74 | |||
| 2e9f5a3241 | |||
| 2c98ce1c3c | |||
| 6dd4abd889 |
@@ -0,0 +1,4 @@
|
||||
.DS_Store
|
||||
build/PhotonNotify/PhotonNotify
|
||||
build/PhotonUploader/upload
|
||||
out/
|
||||
@@ -2,7 +2,7 @@
|
||||
set -euo pipefail
|
||||
|
||||
REPO="$(cd "$(dirname "$0")" && pwd)/build"
|
||||
APP="$HOME/Applications/Photon Uploader.app"
|
||||
APP="./out/Photon Uploader.app"
|
||||
CONTENTS="$APP/Contents"
|
||||
|
||||
echo "==> Building PhotonUploader (menu bar binary)..."
|
||||
@@ -41,4 +41,33 @@ echo "==> Signing..."
|
||||
codesign --force --sign - "$CONTENTS/Helpers/PhotonNotify.app"
|
||||
codesign --force --sign - "$APP"
|
||||
|
||||
echo "==> Done. App installed at: $APP"
|
||||
echo "==> Done. App bundle at: $APP"
|
||||
|
||||
echo "==> Creating DMG..."
|
||||
DMG_STAGING="./out/dmg-staging"
|
||||
DMG_OUT="./out/Photon Uploader.dmg"
|
||||
|
||||
if ! command -v create-dmg &>/dev/null; then
|
||||
echo "Error: create-dmg is not installed. Run: brew install create-dmg" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm -rf "$DMG_STAGING"
|
||||
mkdir -p "$DMG_STAGING"
|
||||
cp -r "$APP" "$DMG_STAGING/"
|
||||
|
||||
rm -f "$DMG_OUT"
|
||||
create-dmg \
|
||||
--volname "Photon Uploader" \
|
||||
--volicon "$REPO/Resources/AppIcon.icns" \
|
||||
--window-pos 200 120 \
|
||||
--window-size 540 380 \
|
||||
--icon-size 96 \
|
||||
--icon "Photon Uploader.app" 140 190 \
|
||||
--hide-extension "Photon Uploader.app" \
|
||||
--app-drop-link 400 190 \
|
||||
"$DMG_OUT" \
|
||||
"$DMG_STAGING"
|
||||
|
||||
rm -rf "$DMG_STAGING"
|
||||
echo "==> Done. DMG at: $DMG_OUT"
|
||||
|
||||
@@ -55,7 +55,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
|
||||
@objc func openLog() {
|
||||
let logPath = (NSHomeDirectory() as NSString)
|
||||
.appendingPathComponent("Documents/Photon/.photon-upload.log")
|
||||
.appendingPathComponent("Documents/Photon/photon-upload.log")
|
||||
NSWorkspace.shared.open(URL(fileURLWithPath: logPath))
|
||||
}
|
||||
|
||||
|
||||
+1
-11
@@ -73,14 +73,6 @@ setup_directories() {
|
||||
log "INFO" "Directory setup complete"
|
||||
}
|
||||
|
||||
# Function to generate a random filename
|
||||
# generate_random_filename() {
|
||||
# local extension="$1"
|
||||
# local timestamp=$(date +%s)
|
||||
# local random_part=$(openssl rand -hex 4)
|
||||
# echo "${timestamp}_${random_part}.${extension}"
|
||||
# }
|
||||
|
||||
generate_random_filename() {
|
||||
local extension="$1"
|
||||
local random_part=$(openssl rand -base64 6 | tr -dc 'A-Za-z' | head -c 8)
|
||||
@@ -123,8 +115,7 @@ validate_ssh_key() {
|
||||
log "WARN" "Fixing SSH key permissions: $SSH_KEY_PATH"
|
||||
chmod 600 "$SSH_KEY_PATH"
|
||||
fi
|
||||
|
||||
echo "[$(date '+%Y-%m-%d %H:%M:%S')] [DEBUG] Using SSH key authentication: $SSH_KEY_PATH" >> "$LOGFILE"
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
@@ -250,7 +241,6 @@ generate_thumbnails() {
|
||||
|
||||
local response
|
||||
if response=$(curl -s "https://${PHOTON_DOMAIN}/job/generate_thumbnails" 2>&1); then
|
||||
log "INFO" "Thumbnail generation response: $response"
|
||||
|
||||
# Parse JSON response to check status
|
||||
if echo "$response" | grep -q '"status":"success"'; then
|
||||
|
||||
Reference in New Issue
Block a user