MUtilities development repository
修订版 | f56c49767ca0c0306b8b7200b5e7f0eb1949deed (tree) |
---|---|
时间 | 2016-12-21 05:02:20 |
作者 | ![]() |
Commiter | LoRd_MuldeR |
Added script for creating release packages.
@@ -258,7 +258,7 @@ namespace MUtils | ||
258 | 258 | /** |
259 | 259 | * \brief Clean up a file name string |
260 | 260 | * |
261 | - * This function ensures that the given string is a valid file (or directory) name. It does so by replacing any illegal characters, i.e. any characters *not* allowed in file names (which explicitly *includes* directory separators). Furthermore, the function will trim/remove specific characters that are *not* allowed directly at the beginning or end of a file name. Finally, the function takes care or special "reserved" file names that are forbidden by the file system. You can use this function to convert user inputs into a valid file name. | |
261 | + * This function ensures that the given string is a valid file (or directory) name. It does so by replacing any illegal characters, i.e. any characters *not* allowed in file names (which explicitly *includes* directory separators). Furthermore, the function will trim/remove specific characters that are *not* allowed directly at the beginning or end of a file name. Finally, the function takes care of special "reserved" file names that are forbidden by the file system. You can use this function to convert user inputs into a valid file name. | |
262 | 262 | * |
263 | 263 | * \param list A read-only reference to the QString holding the original, potentially invalid file name. |
264 | 264 | * |
@@ -269,7 +269,7 @@ namespace MUtils | ||
269 | 269 | /** |
270 | 270 | * \brief Clean up a file path string |
271 | 271 | * |
272 | - * This function ensures that the given string is a valid file (or directory) path. It does so by replacing any illegal characters, i.e. any characters *not* allowed in file paths. Directory separators are preserved, but they will be "canonicalized". Furthermore, in each path component, the function will trim/remove specific characters that are *not* allowed directly at the beginning or end of a path component. Finally, the function takes care or special "reserved" file names that are forbidden by the file system. You can use this function to convert user inputs into a valid file path. | |
272 | + * This function ensures that the given string is a valid file (or directory) path. It does so by replacing any illegal characters, i.e. any characters *not* allowed in file paths. Directory separators are preserved, but they will be "canonicalized". Furthermore, in each path component, the function will trim/remove specific characters that are *not* allowed directly at the beginning or end of a path component. Finally, the function takes care of special "reserved" file names that are forbidden by the file system. You can use this function to convert user inputs into a valid file path. | |
273 | 273 | * |
274 | 274 | * \param list A read-only reference to the QString holding the original, potentially invalid file path. |
275 | 275 | * |
@@ -0,0 +1,31 @@ | ||
1 | +@echo off | |
2 | +set "GIT_PATH=c:\Program Files\Git" | |
3 | +set "PATH=%GIT_PATH%;%GIT_PATH%\mingw64\bin;%GIT_PATH%\usr\bin;%PATH%" | |
4 | +set "OUT_PATH=%TEMP%\~%RANDOM%%RANDOM%.tmp" | |
5 | + | |
6 | +mkdir "%OUT_PATH%" | |
7 | +mkdir "%OUT_PATH%\MUtilities" | |
8 | + | |
9 | +call::git_export "%~dp0\." MUtilities | |
10 | + | |
11 | +pushd "%OUT_PATH%" | |
12 | +tar -cvf ./sources.tar * | |
13 | +"%~dp0\..\Prerequisites\SevenZip\7za.exe" a -txz "%~dp0\~sources.tar.xz" "sources.tar" | |
14 | +popd | |
15 | + | |
16 | +pushd "%~dp0" | |
17 | +rmdir /S /Q "%OUT_PATH%" | |
18 | + | |
19 | +pause | |
20 | +exit | |
21 | + | |
22 | + | |
23 | +:git_export | |
24 | +pushd "%~1" | |
25 | +git archive --verbose --output "%OUT_PATH%\%~2.tar" MASTER | |
26 | +popd | |
27 | +pushd "%OUT_PATH%\%~2" | |
28 | +tar -xvf "../%~2.tar" | |
29 | +del "%OUT_PATH%\%~2.tar" | |
30 | +popd | |
31 | +goto:eof |