Skip to content

Commit

Permalink
Fixing scoop install (#6)
Browse files Browse the repository at this point in the history
- Fixing scoop install issues (file path, etc.)
  • Loading branch information
Nyuwb authored Nov 3, 2022
1 parent df6894c commit fe14903
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
6 changes: 4 additions & 2 deletions src/Config/Loader.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ Class Loader
{
[Hashtable] $Instances = @{}
[Array] $Services
[String] $Version = '0.4'
[String] $Version = '0.5'
[String] $Path

Loader()
{
# Get the root path
$RootPath = (Get-Item $PSScriptRoot).Parent.Parent.FullName
$This.Path = $RootPath +'\config.json'
# Load of the configuration
$Config = Get-Content ($RootPath +'\config.json') -Raw | ConvertFrom-JSON
$Config = Get-Content $This.Path -Raw | ConvertFrom-JSON
# Saving the configuration in the current class
$This.Services = $Config.Services
$This.SetInstances($Config.Instances)
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/AppController.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Class AppController
'^config$' {
# Opening config.yaml with the default editor
[Console]::Write('Opening config.json...')
Invoke-Item 'config.json'
Invoke-Item $Config.Path
}
'^help$' {
# Display the command list
Expand Down
2 changes: 1 addition & 1 deletion src/Controller/ConfigController.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Class ConfigController
{
Static CheckConfigurationFile()
{
$ConfigFile = 'config.json'
$ConfigFile = (Get-Item $PSScriptRoot).Parent.Parent.FullName +'\config.json'
# Checking if the configuration file
if ((Test-Path -Path $ConfigFile) -eq $False) {
Throw 'The configuration file ''config.json'' has not been found, please reinstall the application'
Expand Down
16 changes: 11 additions & 5 deletions wsl-switch.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
{
"version": "0.4",
"version": "0.5",
"description": "Switch WSL service activation from an host to another",
"homepage": "https://github.com/Nyuwb/wsl-switch/",
"license": "MIT license",
"url": "https://github.com/Nyuwb/wsl-switch/releases/download/v0.4/wsl-switch-v0.4.zip",
"hash": "b6fe2f872092c234d9b388b9f4cfe245443cb69515b1148e61ced2105fa1889e",
"url": "https://github.com/Nyuwb/wsl-switch/releases/download/v0.5/wsl-switch-v0.5.zip",
"hash": "83497a31cce3555b828cc7bd47f503414eefd4147f87b10acf24a525a5b2ed18",
"bin": "wsl-switch.ps1",
"persist": "config.json"
}
"persist": [
"config.json"
],
"checkver": "github",
"autoupdate": {
"url": "https://github.com/Nyuwb/wsl-switch/archive/refs/tags/v$version.zip"
}
}

0 comments on commit fe14903

Please sign in to comment.