From 6abfe4d595f0bb26f572c83cb45eb910d191fb2a Mon Sep 17 00:00:00 2001 From: Qubasa Date: Sun, 31 Dec 2023 13:51:13 +0100 Subject: [PATCH] cli: Switched b64 encoding of gcroot names to urlparse --- pkgs/clan-cli/clan_cli/dirs.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/clan-cli/clan_cli/dirs.py b/pkgs/clan-cli/clan_cli/dirs.py index 72126bb12..28da9bb67 100644 --- a/pkgs/clan-cli/clan_cli/dirs.py +++ b/pkgs/clan-cli/clan_cli/dirs.py @@ -1,7 +1,8 @@ -import base64 +import copy import logging import os import sys +import urllib from pathlib import Path log = logging.getLogger(__name__) @@ -45,7 +46,9 @@ def user_gcroot_dir() -> Path: def specific_groot_dir(*, clan_name: str, flake_url: str) -> Path: # Always build icon so that we can symlink it to the gcroot gcroot_dir = user_gcroot_dir() - burl = base64.urlsafe_b64encode(flake_url.encode()).decode() + # burl = base64.urlsafe_b64encode(flake_url.encode()).decode() + burl = copy.copy(flake_url).replace("/", "_").replace(":", "_") + burl = urllib.parse.quote_plus(burl) # Create the directory if it already exists append a number to it till it doesn't exist and then create it clan_gcroot = gcroot_dir / f"{clan_name}-{burl}"