Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/core/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@
# Cleanup the cache dir before saving
def cleanup_cache_dir():
print("Cleaning up the cache directory")
try:
shutil.rmtree(TEMP_CACHE)
except FileNotFoundError:
pass
# The workspace path can be left behind as a file or a symlink instead of a
# directory, and shutil.rmtree is not able to remove either of them
if os.path.islink(TEMP_CACHE) or os.path.isfile(TEMP_CACHE):
os.remove(TEMP_CACHE)
else:
try:
shutil.rmtree(TEMP_CACHE)
except FileNotFoundError:
pass
os.makedirs(TEMP_CACHE, exist_ok=True)
os.chdir(TEMP_CACHE)

Expand Down
2 changes: 2 additions & 0 deletions src/core/de_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ def create_flatpak_list():
print("[OK] Saving Flatpak app list")

def create_flatpak_autostart():
# Without this, cp creates the workspace path as a file when it is missing
os.makedirs(f"{CACHE}/workspace", exist_ok=True)
os.system(f"cp /app/share/savedesktop/savedesktop/core/flatpaks_installer.py {CACHE}/workspace")

# Create a JSON file with the user's preferences for Flatpak apps
Expand Down