Solve the no such file or directory issue

Signed-off-by: Lyes Saadi <33597258+LyesSaadi@users.noreply.github.com>
This commit is contained in:
Lyes Saadi 2022-09-23 21:18:34 +02:00 committed by GitHub
parent f3588c778a
commit edc7d0a133
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -190,6 +190,9 @@ class GradienceApplication(Adw.Application):
buglog("file")
# keep compatiblity with old presets
if repo.name.endswith(".json"):
if not os.path.isdir(os.path.join(PRESET_DIR, "user")):
os.mkdir(os.path.join(PRESET_DIR, "user"))
os.rename(repo, os.path.join(
PRESET_DIR, "user", repo.name))