Skip to content

Commit

Permalink
windows tool refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeTWC1984 committed Apr 5, 2024
1 parent e1acba4 commit c1cd615
Show file tree
Hide file tree
Showing 3 changed files with 155 additions and 98 deletions.
6 changes: 4 additions & 2 deletions bin/control.sh.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ param(
# list collection items
[Int32]$Limit = 50,
[Int32]$Offset = 0,
[switch]$Full
[switch]$Full,

[switch]$Help
)

$ErrorActionPreference = "stop"

if (!$Command) {
if (!$Command -OR $Help) {
Write-Host "Usage:
.\control.ps1 start [-Manager] [-Echo] [-Force] [-Color] [-WinMon] [-Hide]
Expand Down
47 changes: 45 additions & 2 deletions bin/manager.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,49 @@

@echo off
cd /D "%~dp0"

set SCRIPT_LOC=%~dp0

:parseArgs

if "%1"=="" goto endArgs

if /I "%1"=="--port" (
if "%2"=="" (
echo Specify http port for cronicle
exit
)
set CRONICLE_WebServer__http_port=%2
echo Custom port set: %2
shift
shift
) else if /I "%1"=="--storage" (
if "%2"=="" (
echo Specify path to storage.json config file
exit
)
set CRONICLE_storage_config=%~f2
echo Custom storage set: %~f2
shift
shift
) else if /I "%1"=="--key" (
if "%2"=="" (
echo Secret key not specified
exit
)
set CRONICLE_secret_key=%2
echo Using custom secret key: *****
shift
shift
) else if /I "%1"=="--help" (
echo Usage: .\manager [--port port] [ --storage /path/to/storage.json]
shift
) else (exit)

goto parseArgs

:endArgs

cd /D %SCRIPT_LOC%

REM check for custom node version
IF EXIST "%~dp0..\nodejs\node.exe" (
Expand All @@ -14,4 +57,4 @@ if not "%~1"=="" (
echo CRONICLE_http_port is set to %1
)

node .\cronicle.js --manager --echo --foreground --color
node .\cronicle.js --manager --echo --foreground --color
Loading

0 comments on commit c1cd615

Please sign in to comment.