-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
properly support gitlab vs github downloads and folders
- Loading branch information
1 parent
12c2390
commit 5cf8a26
Showing
6 changed files
with
46 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from urllib.parse import urlparse | ||
from functools import lru_cache | ||
|
||
from pbpy import pbconfig | ||
|
||
@lru_cache() | ||
def get_repo_folder(): | ||
hostname = urlparse(pbconfig.get("git_url")).hostname | ||
|
||
if hostname == 'github.com': | ||
return ".github" | ||
elif hostname == 'gitlab.com': | ||
return ".gitlab" | ||
else: | ||
# Fall back to gitlab path as that's most likely | ||
# what our provider will be if we can't determine | ||
return ".gitlab" | ||
|
||
@lru_cache() | ||
def format_repo_folder(base): | ||
return f"{get_repo_folder()}{base}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
ver = "0.3.0" | ||
ver = "0.4.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
ver = "0.5.0" | ||
ver = "0.6.0" |