Skip to content

Commit

Permalink
73a6612 - Azeez Adewale : first sensible and reasonable release
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Thecarisma committed Sep 15, 2019
1 parent 73a6612 commit 82aa203
Show file tree
Hide file tree
Showing 21 changed files with 196 additions and 176 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 1 addition & 4 deletions Cronux.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
85 changes: 66 additions & 19 deletions CronuxTestRunner.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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=^
Expand All @@ -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
Expand All @@ -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!
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion ROADMAP.MD
Original file line number Diff line number Diff line change
Expand Up @@ -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
- [x] create subfolder for script alias
- [ ] next release make sure to remove shortfilename before `!SCRIPT_PATH! !ARGS__!`
4 changes: 4 additions & 0 deletions commands/alias/archive.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions commands/alias/backup.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions commands/alias/cat.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions commands/alias/dir.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions commands/alias/extract.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions commands/alias/help.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions commands/alias/install.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions commands/alias/irs.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions commands/alias/listdir.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions commands/alias/removecommand.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions commands/alias/showzip.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions commands/alias/su.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions commands/alias/sudo.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions commands/alias/uninstall.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions commands/alias/wget.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit 82aa203

Please sign in to comment.