-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcreate_app.sh
More file actions
executable file
·57 lines (49 loc) · 1.5 KB
/
Copy pathcreate_app.sh
File metadata and controls
executable file
·57 lines (49 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
# Nom de l'application
APP_NAME="CTB2MD.app"
APP_PATH="$HOME/Desktop/$APP_NAME"
# Créer la structure de l'application
mkdir -p "$APP_PATH/Contents/"{MacOS,Resources}
# Copier le script Python
cp ctb2md.py "$APP_PATH/Contents/Resources/"
# Créer le script launcher
cat > "$APP_PATH/Contents/MacOS/launcher" << 'EOL'
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
RESOURCES="$( dirname "$DIR" )/Resources"
/usr/bin/env python3 "$RESOURCES/ctb2md.py"
EOL
# Rendre le launcher exécutable
chmod +x "$APP_PATH/Contents/MacOS/launcher"
# Créer le fichier Info.plist
cat > "$APP_PATH/Contents/Info.plist" << 'EOL'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>launcher</string>
<key>CFBundleIconFile</key>
<string>AppIcon</string>
<key>CFBundleIdentifier</key>
<string>com.local.ctb2md</string>
<key>CFBundleName</key>
<string>CTB2MD</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>LSMinimumSystemVersion</key>
<string>10.10</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
</dict>
</plist>
EOL
# Créer une icône simple
cat > "$APP_PATH/Contents/Resources/AppIcon.icns" << 'EOL'
icns
EOL
echo "Application créée sur le bureau : $APP_NAME"