Skip to content

Commit

Permalink
Add error handling for missing config
Browse files Browse the repository at this point in the history
  • Loading branch information
ZigaMr committed Jan 7, 2025
1 parent 1d3fd15 commit b1d96cb
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions scripts/gen_example.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,10 @@ function Initialize-Config {

# Generate initial config by running network ls
& $OASIS_CMD network ls > $null
# if (-not (Test-Path $USER_CFG_DIR)) {
# Write-Error "Failed to generate config file at $USER_CFG_DIR"
# exit 1
# }

# # Create example config directory if it doesn't exist
# if (-not (Test-Path (Split-Path $CFG_DIR))) {
# New-Item -ItemType Directory -Force -Path (Split-Path $CFG_DIR) | Out-Null
# }
if (-not (Test-Path $USER_CFG_DIR)) {
Write-Error "Failed to generate config file at $USER_CFG_DIR"
exit 1
}

# Move the fresh config to example directory
Move-Item -Path $USER_CFG_DIR -Destination $CFG_DIR
Expand Down

0 comments on commit b1d96cb

Please sign in to comment.