File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed
Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 1010 runs-on : ${{ matrix.os }}
1111 strategy :
1212 matrix :
13- os : [windows-latest] # [ ubuntu-latest, macos-latest, windows-latest]
13+ os : [ubuntu-latest, macos-latest, windows-latest]
1414
1515 steps :
1616 - name : Checkout code
3737 - name : Build for Linux
3838 if : matrix.os == 'ubuntu-latest'
3939 run : |
40+ sudo apt-get install -y upx
41+
4042 pyinstaller --onefile --name Scriptify --icon web/favicon.ico --add-data "ffmpeg/ffmpeg_ubuntu.zip:ffmpeg" --hidden-import="whisper" --add-data "whisper:whisper" --exclude-module tkinter --exclude-module PyQt5 \
4143 --add-data "web:web" --add-data "js:js" --add-data "index.html:." --add-data "launch.html:." --add-data "style.css:." \
42- --windowed main.py --version-file version_info.txt
44+ --windowed main.py --version-file version_info.txt --upx-dir /usr/bin
4345
4446 strip dist/Scriptify
4547
Original file line number Diff line number Diff line change 3434else :
3535 base_path = os .path .abspath ("." )
3636
37+ # Determine the directory of the script or the executable
38+ if getattr (sys , 'frozen' , False ):
39+ app_dir = os .path .dirname (sys .executable )
40+ else :
41+ app_dir = os .path .dirname (os .path .abspath (__file__ ))
42+
3743# Set whisper download folder
38- os .environ ["WHISPER_DOWNLOAD_DIR" ] = os .path .join (base_path , "models" )
39- os .environ ["WHISPER_CACHE_DIR" ] = os .path .join (base_path , "models" )
44+ os .environ ["WHISPER_DOWNLOAD_DIR" ] = os .path .join (app_dir , "models" )
45+ os .environ ["WHISPER_CACHE_DIR" ] = os .path .join (app_dir , "models" )
4046
4147def extract_ffmpeg ():
4248 """Extracts the correct FFmpeg binary for the OS and returns its path."""
@@ -292,7 +298,7 @@ def auto_backup(self):
292298 # Format the date and time to fit in a filename
293299 filename_time = now .strftime ("%Y-%m-%d_%H-%M-%S" )
294300 backup_filename = f"{ sanitized_title } _{ filename_time } _backup.scriptify"
295- backup_path = os .path .join (base_path , backup_filename )
301+ backup_path = os .path .join (app_dir , backup_filename )
296302
297303 # Prepare the data to be saved
298304 data = {
You can’t perform that action at this time.
0 commit comments