cli: Switched b64 encoding of gcroot names to urlparse
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
import base64
|
import copy
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
import urllib
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
@@ -45,7 +46,9 @@ def user_gcroot_dir() -> Path:
|
|||||||
def specific_groot_dir(*, clan_name: str, flake_url: str) -> Path:
|
def specific_groot_dir(*, clan_name: str, flake_url: str) -> Path:
|
||||||
# Always build icon so that we can symlink it to the gcroot
|
# Always build icon so that we can symlink it to the gcroot
|
||||||
gcroot_dir = user_gcroot_dir()
|
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
|
# 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}"
|
clan_gcroot = gcroot_dir / f"{clan_name}-{burl}"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user