Skip to content

Commit

Permalink
Run only on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Priyansh121096 committed Jul 8, 2023
1 parent 5131fdc commit 3e3d879
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,22 @@
import shutil
from pathlib import Path

SOURCE_DIR = Path(
f"{os.environ['LOCALAPPDATA']}\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets"
)
DEST_DIR = Path(f"C:\\Users\Admin\Pictures\\Spotlight")

def get_src_dest_dirs():
return (
Path(
f"{os.environ['LOCALAPPDATA']}\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets"
),
Path(f"C:\\Users\Admin\Pictures\\Spotlight"),
)


def main():
if os.name != "nt":
raise RuntimeError(f"This script can only be run on Windows (os.name returns '{os.name}'; should return 'nt').")

SOURCE_DIR, DEST_DIR = get_src_dest_dirs()

if os.path.exists(DEST_DIR) and not os.path.isdir(DEST_DIR):
raise RuntimeError(f"{DEST_DIR} should be a directory.")

Expand Down

0 comments on commit 3e3d879

Please sign in to comment.