From 82aa20359baf6be8400d4149a995503a466247b7 Mon Sep 17 00:00:00 2001 From: Azeez Adewale Date: Sun, 15 Sep 2019 15:26:55 +0100 Subject: [PATCH] 73a6612 - Azeez Adewale : first sensible and reasonable release e8a91e3 - Azeez Adewale : first sensible and reasonable release ac12e3f - Azeez Adewale : resolve some issue with inline execution f52e7a8 - Azeez Adewale : resolve some issue with inline execution 33fd086 - Azeez Adewale : resolve some issue with inline execution 01af154 - Azeez Adewale : resolve some issue with inline execution 6d52d5e - Azeez Adewale : resolve some issue with inline execution 6b62dde - Azeez Adewale : resolve some issue with inline execution ac47ae5 - Azeez Adewale : resolve some issue with inline execution 2508744 - Azeez Adewale : resolve some issue with inline execution 9b9474e - Azeez Adewale : resolve some issue with inline execution ced4083 - Azeez Adewale : resolve some issue with inline execution 33c86a7 - Azeez Adewale : change the temp CronuxTestSource file to the .\build\ folder 5049fef - Azeez Adewale : change the temp CronuxTestSource file to the .\build\ folder e819281 - Azeez Adewale : add travis CI/CD configuration to Cronux b8d1578 - Azeez Adewale : add travis CI/CD configuration to Cronux d81cdf7 - Azeez Adewale : add travis CI/CD configuration to Cronux 77aa580 - Azeez Adewale : add travis CI/CD configuration to Cronux 3e7ffc2 - Azeez Adewale : add command script to build zip and independent cronux file f0ec420 - Azeez Adewale : resolve not finding command in command folder ef7d852 - Azeez Adewale : allow sub folder iteration for compilation and installation 2c609ff - Azeez Adewale : modify existing script to add is_administrator variable and function 7946b45 - Azeez Adewale : add is_administrator function to check if command prompt is open as administrator bfb961e - Azeez Adewale : add test to check if display function is used and defined c86e8a0 - Azeez Adewale : add test to check :call_command_label is defined if used in the main script secgment 731d4d4 - Azeez Adewale : write label base loop for iterating commands folders and subfolders 6ea78de - Azeez Adewale : write label base loop for iterating commands folders and subfolders eb5371c - Azeez Adewale : add test to check call_command_script label position d913018 - Azeez Adewale : add more test cases, and magic items b6bfbd3 - Azeez Adewale : make all new script pass test cases 29406cf - Azeez Adewale : make all new script pass test cases :devil: 9beae00 - Azeez Adewale : make all new script pass test cases :devil: 3f0781c - Azeez Adewale : did more batch sourcery and magic 4e39275 - Azeez Adewale : create the CronuxTestRunner script to run test on batch script bebc97d - Azeez Adewale : create Contributing guide, close and sleep command, blah blah blah 32560dd - Azeez Adewale : created the command for touch and fucking update the readme for fuckers c4065b5 - Azeez Adewale : create command to evaluate inline command linux and unix style and 0627085 - Azeez Adewale : add command scripts to manage running process 3d77d74 - Azeez Adewale : resolve production remove issue 6d5f386 - Azeez Adewale : re write cinstall to treat admin installation from within itself cf1bedf - Azeez Adewale : make Cronux pluginable and expandable 1a39f6c - Azeez Adewale : create the listzip, showzip command to list content of a zip file ae2e5ab - Azeez Adewale : create the unzip, extract command to extract zip file 16ec842 - Azeez Adewale : create the zip, archive command to create zip file df34eaa - Azeez Adewale : install remove Cronux path and add new path 28de971 - Azeez Adewale : create the delpath command to remove a folder from the path environemnt afetr backing up the Path environment da1e641 - Azeez Adewale : complete the addpath command to carefully and properlly add a folder to path environment 9a2d2d6 - Azeez Adewale : add more command and shorten some command name c9e3974 - Azeez Adewale : allow installation of all the script in command/ a3f7845 - Azeez Adewale : add the command to build and compile independent command into a single file --- .travis.yml | 4 +- Cronux.bat | 5 +- CronuxTestRunner.bat | 85 ++++++++++++++---- ROADMAP.MD | 3 +- commands/alias/archive.bat | 4 + commands/alias/backup.bat | 4 + commands/alias/cat.bat | 4 + commands/alias/dir.bat | 4 + commands/alias/extract.bat | 4 + commands/alias/help.bat | 4 + commands/alias/install.bat | 4 + commands/alias/irs.bat | 4 + commands/alias/listdir.bat | 4 + commands/alias/removecommand.bat | 4 + commands/alias/showzip.bat | 4 + commands/alias/su.bat | 4 + commands/alias/sudo.bat | 4 + commands/alias/uninstall.bat | 4 + commands/alias/wget.bat | 4 + commands/git/gitlog.bat | 150 ------------------------------- commands/git/gitlogp.bat | 65 ++++++++++++++ 21 files changed, 196 insertions(+), 176 deletions(-) delete mode 100644 commands/git/gitlog.bat create mode 100644 commands/git/gitlogp.bat diff --git a/.travis.yml b/.travis.yml index 21f85e8..53d464c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ deploy: api_key: $GITHUB_TOKEN file_glob: true file: - - "build/$(./Cronux.bat version)/Cronux*.bat" - - "build/$(./Cronux.bat version)/Cronux*.zip" + - "build/$(./Cronux.bat version)/Cronux.bat" + - "build/$(./Cronux.bat version)/Cronux.$(./Cronux.bat version).zip" on: tags: true diff --git a/Cronux.bat b/Cronux.bat index f13f95e..d08d2c9 100644 --- a/Cronux.bat +++ b/Cronux.bat @@ -112,10 +112,7 @@ REM call:display_warning Cronux cannot find the batch label specified - %1. Delegating to system SET SCRIPT_PATH=%1 ) - ) - for %%i in ("!SCRIPT_PATH!") do ( - SET SCRIPT_PATH=%%~si - ) + ) cd !WORKING_DIR! !SCRIPT_PATH! !ARGS__! goto:call_command_script__end diff --git a/CronuxTestRunner.bat b/CronuxTestRunner.bat index a3dd47b..d6544c7 100644 --- a/CronuxTestRunner.bat +++ b/CronuxTestRunner.bat @@ -20,6 +20,7 @@ SET SET ERROR_MESSAGE= SET UNIT_TEST_FAILED=false SET BACKSPACE= SET CURRENT_SCRIPT_SOURCE= +SET FOLDERS_TO_TEST=!COMMANDS_FOLDER! SET VERBOSE=true SET ERROR_CODE=677 SET LF=^ @@ -37,7 +38,7 @@ SET ALREADY_TESTED_SCRIPT=tests SET BLACKLISTED_NAMES=cls CronuxTestRunner Cronux tests SET DEAFULT_VARIABLES=OP_ARGS SCRIPT_DIR WORKING_DIR USER_FOLDER INSTALLATION_FOLDER ROAMING_FOLDER BACKUP_FOLDER IS_ADMIN -if not exist (".\build") ( +if not exist ".\build\" ( mkdir .\build\ ) for /f %%A in ('"prompt $H &echo on &for %%B in (1) do rem"') do SET BACKSPACE=%%A @@ -54,25 +55,69 @@ if "!FILES_TO_RUN_TEST_ON!"=="" ( call:printline exit /b 0 ) - cd !COMMANDS_FOLDER! - for %%f in (*) do ( - FOR %%i IN ("%%f") DO ( - SET filedrive=%%~di - SET filepath=%%~pi - SET filename=%%~ni - SET fileextension=%%~xi - ) - SET SINGLE_COMMAND_SCRIPT=!filedrive!!filepath!!filename!!fileextension! + + SET COMMANDS_FOLDER__=!COMMANDS_FOLDER! + goto:test_scripts_loop +) else ( + if exist "!FILES_TO_RUN_TEST_ON!" ( + goto:start_testing_files + ) else ( + call:display_error currently does not support directory as argument + call:display_error cd to the directory and execute `CronuxTestRunner` + exit /b 677 + ) +) + +:test_scripts_complete +cd !WORKING_DIR! +for %%f in (!FOLDERS_TO_TEST!) do ( + cd %%f + for %%g in (*.*) do ( + for %%i in ("%%g") do ( + SET shortfullname=%%~si + ) if "!FILES_TO_RUN_TEST_ON!"=="" ( - SET FILES_TO_RUN_TEST_ON=!SINGLE_COMMAND_SCRIPT! + SET FILES_TO_RUN_TEST_ON=!shortfullname! ) else ( - SET FILES_TO_RUN_TEST_ON=!FILES_TO_RUN_TEST_ON! !SINGLE_COMMAND_SCRIPT! + SET FILES_TO_RUN_TEST_ON=!FILES_TO_RUN_TEST_ON! !shortfullname! ) ) - cd !WORKING_DIR! - call:printline ) +cd !WORKING_DIR! +call:printline +goto:start_testing_files + +:test_scripts_loop + cd !COMMANDS_FOLDER__! + for /d %%d in (*.*) do ( + for %%i in ("%%d") do ( + SET shortfullname=%%~si + ) + SET FOLDERS_TO_TEST=!FOLDERS_TO_TEST! !shortfullname!\ + if "!FOLDERS_TO_VISIT__!"=="" ( + SET FOLDERS_TO_VISIT__=!shortfullname! + ) else ( + SET FOLDERS_TO_VISIT__=!FOLDERS_TO_VISIT__! !shortfullname! + ) + ) + for %%g in (!FOLDERS_TO_VISIT__!) do ( + SET COMMANDS_FOLDER__=%%g + SET FOLDERS_TO_VISIT__HOLDER=!FOLDERS_TO_VISIT__! + SET FOLDERS_TO_VISIT__= + for %%f in (!FOLDERS_TO_VISIT__HOLDER!) do ( + if not "%%f"=="%%g" ( + if "!FOLDERS_TO_VISIT__!"=="" ( + SET FOLDERS_TO_VISIT__=%%f + ) else ( + SET FOLDERS_TO_VISIT__=!FOLDERS_TO_VISIT__! %%f + ) + ) + ) + goto:test_scripts_loop + ) + goto:test_scripts_complete +:start_testing_files for %%a in (!FILES_TO_RUN_TEST_ON!) do ( SET /a SUB_TOTAL_TEST=!SUB_TOTAL_TEST!-!SUB_TOTAL_TEST! SET /a SUB_FAILED_TEST_COUNT=!SUB_FAILED_TEST_COUNT!-!SUB_FAILED_TEST_COUNT! @@ -212,11 +257,13 @@ REM Check the filename attribute for conflict and error :check_file_name__extension call:a_display %BACKSPACE% checking the filename extension - if not "%3"==".bat" ( - SET /a SUB_FAILED_TEST_COUNT=!SUB_FAILED_TEST_COUNT!+1 - SET ERROR_MESSAGE=invalid filename extension '%3', .bat expected - SET UNIT_TEST_FAILED=true - call:printerror_value !ERROR_MESSAGE! - goto:check_file_name__end + if not "%3"==".BAT" ( + SET /a SUB_FAILED_TEST_COUNT=!SUB_FAILED_TEST_COUNT!+1 + SET ERROR_MESSAGE=invalid filename extension '%3', .bat expected + SET UNIT_TEST_FAILED=true + call:printerror_value !ERROR_MESSAGE! + goto:check_file_name__end + ) ) echo  [passed] SET /a SUB_PASSED_TEST_COUNT=!SUB_PASSED_TEST_COUNT!+1 diff --git a/ROADMAP.MD b/ROADMAP.MD index c34f8da..18c968c 100644 --- a/ROADMAP.MD +++ b/ROADMAP.MD @@ -45,4 +45,5 @@ - [ ] create a wildcard resolver command - [ ] git command to create release note from commit from last release or a commit hash, issue and pull request - [ ] command to printout aboutn and all contributor of the scripts (treat in cinstall) - - [x] create subfolder for script alias \ No newline at end of file + - [x] create subfolder for script alias + - [ ] next release make sure to remove shortfilename before `!SCRIPT_PATH! !ARGS__!` \ No newline at end of file diff --git a/commands/alias/archive.bat b/commands/alias/archive.bat index 8417706..50272cb 100644 --- a/commands/alias/archive.bat +++ b/commands/alias/archive.bat @@ -126,6 +126,10 @@ REM End of the actual operating script echo Cronux.archive: %* exit /b 0 +:display_warning + echo Cronux.cinstall: %* + exit /b 0 + :is_administrator SET is_administrator_var= for /F "tokens=* USEBACKQ" %%F in (`fsutil dirty query %systemdrive%`) do SET is_administrator_var=%%F diff --git a/commands/alias/backup.bat b/commands/alias/backup.bat index b4ecd1d..91bd8fc 100644 --- a/commands/alias/backup.bat +++ b/commands/alias/backup.bat @@ -126,6 +126,10 @@ REM End of the actual operating script echo Cronux.backup: %* exit /b 0 +:display_warning + echo Cronux.cinstall: %* + exit /b 0 + :is_administrator SET is_administrator_var= for /F "tokens=* USEBACKQ" %%F in (`fsutil dirty query %systemdrive%`) do SET is_administrator_var=%%F diff --git a/commands/alias/cat.bat b/commands/alias/cat.bat index 5ecd948..429fbeb 100644 --- a/commands/alias/cat.bat +++ b/commands/alias/cat.bat @@ -126,6 +126,10 @@ REM End of the actual operating script echo Cronux.cat: %* exit /b 0 +:display_warning + echo Cronux.cinstall: %* + exit /b 0 + :is_administrator SET is_administrator_var= for /F "tokens=* USEBACKQ" %%F in (`fsutil dirty query %systemdrive%`) do SET is_administrator_var=%%F diff --git a/commands/alias/dir.bat b/commands/alias/dir.bat index 67e69ec..8108906 100644 --- a/commands/alias/dir.bat +++ b/commands/alias/dir.bat @@ -126,6 +126,10 @@ REM End of the actual operating script echo Cronux.dir: %* exit /b 0 +:display_warning + echo Cronux.cinstall: %* + exit /b 0 + :is_administrator SET is_administrator_var= for /F "tokens=* USEBACKQ" %%F in (`fsutil dirty query %systemdrive%`) do SET is_administrator_var=%%F diff --git a/commands/alias/extract.bat b/commands/alias/extract.bat index 952cf80..f81a6f3 100644 --- a/commands/alias/extract.bat +++ b/commands/alias/extract.bat @@ -126,6 +126,10 @@ REM End of the actual operating script echo Cronux.extract: %* exit /b 0 +:display_warning + echo Cronux.cinstall: %* + exit /b 0 + :is_administrator SET is_administrator_var= for /F "tokens=* USEBACKQ" %%F in (`fsutil dirty query %systemdrive%`) do SET is_administrator_var=%%F diff --git a/commands/alias/help.bat b/commands/alias/help.bat index 3eb7e87..a351ee5 100644 --- a/commands/alias/help.bat +++ b/commands/alias/help.bat @@ -126,6 +126,10 @@ REM End of the actual operating script echo Cronux.showzip: %* exit /b 0 +:display_warning + echo Cronux.cinstall: %* + exit /b 0 + :is_administrator SET is_administrator_var= for /F "tokens=* USEBACKQ" %%F in (`fsutil dirty query %systemdrive%`) do SET is_administrator_var=%%F diff --git a/commands/alias/install.bat b/commands/alias/install.bat index 67ac57f..9de6ce6 100644 --- a/commands/alias/install.bat +++ b/commands/alias/install.bat @@ -126,6 +126,10 @@ REM End of the actual operating script echo Cronux.install: %* exit /b 0 +:display_warning + echo Cronux.cinstall: %* + exit /b 0 + :is_administrator SET is_administrator_var= for /F "tokens=* USEBACKQ" %%F in (`fsutil dirty query %systemdrive%`) do SET is_administrator_var=%%F diff --git a/commands/alias/irs.bat b/commands/alias/irs.bat index bed9c5c..1282674 100644 --- a/commands/alias/irs.bat +++ b/commands/alias/irs.bat @@ -126,6 +126,10 @@ REM End of the actual operating script echo Cronux.irs: %* exit /b 0 +:display_warning + echo Cronux.cinstall: %* + exit /b 0 + :is_administrator SET is_administrator_var= for /F "tokens=* USEBACKQ" %%F in (`fsutil dirty query %systemdrive%`) do SET is_administrator_var=%%F diff --git a/commands/alias/listdir.bat b/commands/alias/listdir.bat index 901044f..8dfa9f0 100644 --- a/commands/alias/listdir.bat +++ b/commands/alias/listdir.bat @@ -126,6 +126,10 @@ REM End of the actual operating script echo Cronux.listdir: %* exit /b 0 +:display_warning + echo Cronux.cinstall: %* + exit /b 0 + :is_administrator SET is_administrator_var= for /F "tokens=* USEBACKQ" %%F in (`fsutil dirty query %systemdrive%`) do SET is_administrator_var=%%F diff --git a/commands/alias/removecommand.bat b/commands/alias/removecommand.bat index 430af20..13a5a84 100644 --- a/commands/alias/removecommand.bat +++ b/commands/alias/removecommand.bat @@ -126,6 +126,10 @@ REM End of the actual operating script echo Cronux.removecommand: %* exit /b 0 +:display_warning + echo Cronux.cinstall: %* + exit /b 0 + :is_administrator SET is_administrator_var= for /F "tokens=* USEBACKQ" %%F in (`fsutil dirty query %systemdrive%`) do SET is_administrator_var=%%F diff --git a/commands/alias/showzip.bat b/commands/alias/showzip.bat index 406d3ca..d15d41d 100644 --- a/commands/alias/showzip.bat +++ b/commands/alias/showzip.bat @@ -126,6 +126,10 @@ REM End of the actual operating script echo Cronux.showzip: %* exit /b 0 +:display_warning + echo Cronux.cinstall: %* + exit /b 0 + :is_administrator SET is_administrator_var= for /F "tokens=* USEBACKQ" %%F in (`fsutil dirty query %systemdrive%`) do SET is_administrator_var=%%F diff --git a/commands/alias/su.bat b/commands/alias/su.bat index 168a60c..96164fa 100644 --- a/commands/alias/su.bat +++ b/commands/alias/su.bat @@ -126,6 +126,10 @@ REM End of the actual operating script echo Cronux.su: %* exit /b 0 +:display_warning + echo Cronux.cinstall: %* + exit /b 0 + :is_administrator SET is_administrator_var= for /F "tokens=* USEBACKQ" %%F in (`fsutil dirty query %systemdrive%`) do SET is_administrator_var=%%F diff --git a/commands/alias/sudo.bat b/commands/alias/sudo.bat index e3094ca..fc42700 100644 --- a/commands/alias/sudo.bat +++ b/commands/alias/sudo.bat @@ -126,6 +126,10 @@ REM End of the actual operating script echo Cronux.sudo: %* exit /b 0 +:display_warning + echo Cronux.cinstall: %* + exit /b 0 + :is_administrator SET is_administrator_var= for /F "tokens=* USEBACKQ" %%F in (`fsutil dirty query %systemdrive%`) do SET is_administrator_var=%%F diff --git a/commands/alias/uninstall.bat b/commands/alias/uninstall.bat index 217a6a8..6a648be 100644 --- a/commands/alias/uninstall.bat +++ b/commands/alias/uninstall.bat @@ -126,6 +126,10 @@ REM End of the actual operating script echo Cronux.uninstall: %* exit /b 0 +:display_warning + echo Cronux.cinstall: %* + exit /b 0 + :is_administrator SET is_administrator_var= for /F "tokens=* USEBACKQ" %%F in (`fsutil dirty query %systemdrive%`) do SET is_administrator_var=%%F diff --git a/commands/alias/wget.bat b/commands/alias/wget.bat index 326f4eb..6b6be68 100644 --- a/commands/alias/wget.bat +++ b/commands/alias/wget.bat @@ -126,6 +126,10 @@ REM End of the actual operating script echo Cronux.wget: %* exit /b 0 +:display_warning + echo Cronux.cinstall: %* + exit /b 0 + :is_administrator SET is_administrator_var= for /F "tokens=* USEBACKQ" %%F in (`fsutil dirty query %systemdrive%`) do SET is_administrator_var=%%F diff --git a/commands/git/gitlog.bat b/commands/git/gitlog.bat deleted file mode 100644 index 7f3ac98..0000000 --- a/commands/git/gitlog.bat +++ /dev/null @@ -1,150 +0,0 @@ -@echo off -SET errorlevel=0 -setlocal enabledelayedexpansion - -SET OPERATION="none" -SET OP_ARGS= -SET SCRIPT_DIR=%~dp0 -SET WORKING_DIR=%cd% -SET IS_ADMIN=false -call:is_administrator - -SET USER_FOLDER=%HOMEDRIVE%%HOMEPATH% -SET INSTALLATION_FOLDER=C:\Program Files\Cronux\ -SET ROAMING_FOLDER=!USER_FOLDER!\AppData\Roaming\Cronux\ -SET BACKUP_FOLDER=!ROAMING_FOLDER!backup\ - -REM Place the operation script in the block below -REM START_OFFSET_FOR_MERGE - -REM P -REM An alias for the git command to show the log in a git repository -REM before executing the command you have to change directory to the -REM repository folder and you must have git installed on your Windows -REM -REM :: -REM Usage: gitlog [all the argument to git log command] -REM -REM Download git at https://git-scm.com/ -REM -REM - -call:call_command_script git status - -REM END_OFFSET_FOR_MERGE -REM End of the actual operating script - -:call_command_script - SET LABEL_EXECUTED=false - SET SCRIPT_PATH= - SET COMMANDS_FOLDER__=.\ - SET FOLDERS_TO_VISIT__= - SET ARGS__= - SET BACKWARD_SEARCH_PATHS=..\ ..\..\ ..\..\..\ - for %%a in (%*) do ( - if "!SCRIPT_PATH!"=="" ( - SET SCRIPT_PATH=%%a.bat - ) else ( - if "!ARGS__!"=="" ( - SET ARGS__=%%a - ) else ( - SET ARGS__=!ARGS__! %%a - ) - ) - ) - if "!SCRIPT_PATH!"=="" ( - call:display_error the script name or path cannot be empty - SET errorlevel=677 - goto:eof - ) - if not exist "!SCRIPT_PATH!" ( - goto:call_command_script_loop - ) - :call_command_script__search_complete - cd !SCRIPT_DIR! - if not exist "!SCRIPT_PATH!" ( - for %%b in (!BACKWARD_SEARCH_PATHS!) do ( - if exist "%%b\%1.bat" ( - SET SCRIPT_PATH=%%b\%1.bat - goto:call_command_script__search_complete - ) - ) - call:display_error cannot find the script '%1' - cd !WORKING_DIR! - call:%1 !ARGS__! 2> nul && SET LABEL_EXECUTED=true - if !LABEL_EXECUTED!==true ( - exit /b 0 - ) else ( - call:display_warning Cronux cannot find the batch label specified - %1. Delegating to system - SET SCRIPT_PATH=%1 - ) - ) - for %%i in ("!SCRIPT_PATH!") do ( - SET SCRIPT_PATH=%%~si - ) - cd !WORKING_DIR! - !SCRIPT_PATH! !ARGS__! - goto:call_command_script__end - - :call_command_script_loop - cd !COMMANDS_FOLDER__! - for /d %%d in (*.*) do ( - for %%i in ("%%d") do ( - SET shortfullname=%%~si - ) - REM echo !shortfullname!\%1.bat - if not exist "!shortfullname!\%1.bat" ( - if "!FOLDERS_TO_VISIT__!"=="" ( - SET FOLDERS_TO_VISIT__=!shortfullname!\ - ) else ( - SET FOLDERS_TO_VISIT__=!FOLDERS_TO_VISIT__! !shortfullname!\ - ) - ) else ( - SET SCRIPT_PATH=!shortfullname!\%1.bat - goto:call_command_script__search_complete - ) - ) - for %%g in (!FOLDERS_TO_VISIT__!) do ( - SET COMMANDS_FOLDER__=%%g - SET FOLDERS_TO_VISIT__HOLDER=!FOLDERS_TO_VISIT__! - SET FOLDERS_TO_VISIT__= - for %%f in (!FOLDERS_TO_VISIT__HOLDER!) do ( - if not "%%f"=="%%g" ( - if "!FOLDERS_TO_VISIT__!"=="" ( - SET FOLDERS_TO_VISIT__=%%f - ) else ( - SET FOLDERS_TO_VISIT__=!FOLDERS_TO_VISIT__! %%f - ) - ) - ) - goto:call_command_script_loop - ) - goto:call_command_script__search_complete - - :call_command_script__end - exit /b 0 - -:display - echo Cronux.gitlog: %* - exit /b 0 - -:display_error - echo Cronux.gitlog: %* - exit /b 0 - -:is_administrator - SET is_administrator_var= - for /F "tokens=* USEBACKQ" %%F in (`fsutil dirty query %systemdrive%`) do SET is_administrator_var=%%F - if "x!is_administrator_var:denied=!"=="x!is_administrator_var!" ( SET IS_ADMIN=true) - exit /b 0 - -REM S -REM :copyright: 2019, Azeez Adewale -REM :copyright: GNU LESSER GENERAL PUBLIC LICENSE v3 (c) 2019 Cronux -REM :author: Azeez Adewale -REM :date: 12 September 2019 -REM :time: 09:24 PM -REM :filename: gitlog.bat -REM -REM -REM .. _ALink: ./ALink.html diff --git a/commands/git/gitlogp.bat b/commands/git/gitlogp.bat new file mode 100644 index 0000000..d8ba545 --- /dev/null +++ b/commands/git/gitlogp.bat @@ -0,0 +1,65 @@ +@echo off +SET errorlevel=0 +setlocal enabledelayedexpansion + +SET OPERATION="none" +SET OP_ARGS= +SET SCRIPT_DIR=%~dp0 +SET WORKING_DIR=%cd% +SET IS_ADMIN=false +call:is_administrator + +SET USER_FOLDER=%HOMEDRIVE%%HOMEPATH% +SET INSTALLATION_FOLDER=C:\Program Files\Cronux\ +SET ROAMING_FOLDER=!USER_FOLDER!\AppData\Roaming\Cronux\ +SET BACKUP_FOLDER=!ROAMING_FOLDER!backup\ + +REM Place the operation script in the block below +REM START_OFFSET_FOR_MERGE + +REM P +REM An alias for the git command to show the log in a git repository +REM before executing the command you have to change directory to the +REM repository folder and you must have git installed on your Windows +REM +REM :: +REM Usage: gitlogp +REM +REM Download git at https://git-scm.com/ +REM + +git log --pretty=format:"%%h - %%an : %%s" %* + +exit /b 0 + +REM END_OFFSET_FOR_MERGE +REM End of the actual operating script + +:display + echo Cronux.gitlogp: %* + exit /b 0 + +:display_error + echo Cronux.gitlogp: %* + exit /b 0 + +:display_warning + echo Cronux.cinstall: %* + exit /b 0 + +:is_administrator + SET is_administrator_var= + for /F "tokens=* USEBACKQ" %%F in (`fsutil dirty query %systemdrive%`) do SET is_administrator_var=%%F + if "x!is_administrator_var:denied=!"=="x!is_administrator_var!" ( SET IS_ADMIN=true) + exit /b 0 + +REM S +REM :copyright: 2019, Azeez Adewale +REM :copyright: GNU LESSER GENERAL PUBLIC LICENSE v3 (c) 2019 Cronux +REM :author: Azeez Adewale +REM :date: 12 September 2019 +REM :time: 09:24 PM +REM :filename: gitlogp.bat +REM +REM +REM .. _ALink: ./ALink.html