A CLI tool for downloading from pixiv.net
Revisão | 0432d74f851e4bb53d0cfb8aa4c2e4c2f636b918 (tree) |
---|---|
Hora | 2023-08-07 18:44:33 |
Autor | mio <stigma@disr...> |
Commiter | mio |
Change version identifier to date+hash
@@ -9,7 +9,7 @@ targetType "executable" | ||
9 | 9 | versions "GMagick_Static" |
10 | 10 | libs "GraphicsMagick" |
11 | 11 | |
12 | - | |
12 | +preBuildCommands "sh insert_gitversion.sh" | |
13 | 13 | |
14 | 14 | # We have a hard dependency on magickd so we can choose the subConfiguration |
15 | 15 | dependency "magickd:graphicsmagick_c" \ |
@@ -0,0 +1,21 @@ | ||
1 | +#!/bin/sh | |
2 | + | |
3 | +if [ -d ".git" ] | |
4 | +then | |
5 | + which git >/dev/null || exit 0 | |
6 | + | |
7 | + # Keep all but the last two lines | |
8 | + git_version_file="$(head -n -2 source/git_version.d)" | |
9 | + printf "%s\n\n" "$git_version_file" > source/git_version.d | |
10 | + | |
11 | + | |
12 | + version="$(git show --pretty='%cd %h' --date=format:%Y-%m --no-patch --no-notes HEAD)" | |
13 | + gdate="$(printf '%s' "$version" | cut -d' ' -f1)" | |
14 | + ghash="$(printf '%s' "$version" | cut -d' ' -f2)" | |
15 | + printf 'enum gitDate = "%s";\n' "$gdate" >> source/git_version.d | |
16 | + printf 'enum gitHash = "%s";\n' "$ghash" >> source/git_version.d | |
17 | + | |
18 | + printf "[insert_gitversion] Success!\n" | |
19 | +fi | |
20 | + | |
21 | + |
@@ -39,6 +39,7 @@ import std.net.curl : CurlException; | ||
39 | 39 | |
40 | 40 | import configparser; |
41 | 41 | import directories; |
42 | +import git_version; | |
42 | 43 | |
43 | 44 | import pixivd.enums; |
44 | 45 | import pixivd.types; |
@@ -64,7 +65,7 @@ FileLogger log; | ||
64 | 65 | version(appimage) { |
65 | 66 | enum ProgramName = "pixiv_down"; |
66 | 67 | } |
67 | -enum PixivDownVersionString = "0.2-dev"; | |
68 | +enum PixivDownVersionString = gitDate ~ " (" ~ gitHash ~ ")"; | |
68 | 69 | |
69 | 70 | /** |
70 | 71 | * Prompt for the PHPSESSID cookie. |
@@ -0,0 +1,20 @@ | ||
1 | +/* | |
2 | + * pixiv_down - CLI-based downloading tool for https://www.pixiv.net. | |
3 | + * Copyright (C) 2023 Mio | |
4 | + * | |
5 | + * This program is free software: you can redistribute it and/or modify | |
6 | + * it under the terms of the GNU General Public License as published by | |
7 | + * the Free Software Foundation, version 3 of the License. | |
8 | + * | |
9 | + * This program is distributed in the hope that it will be useful, | |
10 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | + * GNU General Public License for more details. | |
13 | + * | |
14 | + * You should have received a copy of the GNU General Public License | |
15 | + * along with this program. If not, see <https://www.gnu.org/licenses/>. | |
16 | + */ | |
17 | +module git_version; | |
18 | + | |
19 | +enum gitDate = "2023-07"; | |
20 | +enum gitHash = "95267e3"; |