|
82 | 82 | if repodata['provider'] == 'github':
|
83 | 83 | giturl = "https://github.com/" + repodata['repo']
|
84 | 84 | elif repodata['provider'] == 'gitlab':
|
85 |
| - giturl = "https://gitlab.com/" + repodata['repo'] |
| 85 | + giturl = "https://gitlab.com/" + repodata['repo'] + ".git/" |
86 | 86 | else:
|
87 | 87 | sys.stderr.write("ERROR: unknown or missing provider '%s'\n" % repodata['provider'])
|
88 | 88 | sys.exit(3)
|
89 | 89 |
|
90 | 90 | if os.path.isdir(gitdir):
|
91 | 91 | os.chdir(gitdir)
|
92 | 92 |
|
93 |
| - cached_commit = sh.git("rev-parse", "HEAD", "--", _err_to_out=True, _out=sys.stdout) |
| 93 | + cached_commit = sh.git("rev-parse", "HEAD", "--", _err_to_out=True) |
94 | 94 |
|
95 | 95 | if args.verbose:
|
96 | 96 | sys.stdout.write("INFO: pulling changes from git repo %s\n" % giturl)
|
97 | 97 | sh.git.pull("origin", repodata["branch"], _err_to_out=True, _out=sys.stdout)
|
98 | 98 | if args.verbose:
|
99 | 99 | sys.stdout.write("INFO: pull complete\n")
|
100 | 100 |
|
101 |
| - current_commit = sh.git("rev-parse", "HEAD", _err_to_out=True, _out=sys.stdout) |
| 101 | + current_commit = sh.git("rev-parse", "HEAD", _err_to_out=True) |
102 | 102 | if cached_commit == current_commit:
|
103 | 103 | if args.always:
|
104 | 104 | sys.stdout.write("INFO: no changes to repo since last run but processing anyway\n")
|
|
136 | 136 | sys.stdout.write("INFO: switching to branch '%s'\n" % (repodata['branch']))
|
137 | 137 | sh.git.checkout(repodata['branch'], _err_to_out=True, _out=sys.stdout)
|
138 | 138 |
|
139 |
| - current_commit = sh.git("rev-parse", "HEAD", _err_to_out=True, _out=sys.stdout) |
140 |
| - last_mod = "%s" % sh.git.log("-1", "--format=%cd", "--date=iso", _tty_out=False) |
| 139 | + current_commit = sh.git("rev-parse", "HEAD", _err_to_out=True) |
| 140 | + last_mod = ("%s" % sh.git.log("-1", "--format=%cd", "--date=iso", _tty_out=False)).strip() |
141 | 141 | sys.stdout.write("INFO: last modified on %s\n" % last_mod)
|
142 | 142 |
|
143 | 143 | logodir = os.path.join(gitdir, repodata['directory'])
|
|
208 | 208 | sys.stdout.write("DEBUG: repo %s copy from '%s' to '%s' (%s)\n" % (repo_handle, str(srcpath), dstpath, shortpath))
|
209 | 209 |
|
210 | 210 | imgurl = args.cdnprefix + shortpath
|
211 |
| - else: |
| 211 | + elif args.provider == 'github': |
212 | 212 | imgurl = "https://raw.githubusercontent.com/" + repodata["repo"] + "/" + repodata["branch"] + srcpath[len(gitdir):]
|
213 |
| - |
| 213 | + elif args.provider == 'gitlab': |
| 214 | + imgurl = "https://gitlab.svg.zone/" + repodata["repo"] + "/raw/" + repodata["branch"] + srcpath[len(gitdir):] |
214 | 215 |
|
215 | 216 | images.append({
|
216 | 217 | 'name': name,
|
|
0 commit comments