forked from wailsapp/wails
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3e3f7b9
commit e91c30f
Showing
8 changed files
with
134 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package doctor | ||
|
||
import ( | ||
"bytes" | ||
"os/exec" | ||
"strconv" | ||
"strings" | ||
) | ||
|
||
func checkCommonDependencies(result map[string]string, ok *bool) { | ||
// Check for npm | ||
npmVersion := []byte("Not Installed. Requires npm >= 7.0.0") | ||
npmVersion, err := exec.Command("npm", "-v").Output() | ||
if err != nil { | ||
*ok = false | ||
} else { | ||
npmVersion = bytes.TrimSpace(npmVersion) | ||
// Check that it's at least version 7 by converting first byte to int and checking if it's >= 7 | ||
// Parse the semver string | ||
semver := strings.Split(string(npmVersion), ".") | ||
if len(semver) > 0 { | ||
major, _ := strconv.Atoi(semver[0]) | ||
if major < 7 { | ||
*ok = false | ||
npmVersion = append(npmVersion, []byte(". Installed, but requires npm >= 7.0.0")...) | ||
} | ||
} | ||
} | ||
result["npm"] = string(npmVersion) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package doctor | ||
|
||
import "testing" | ||
|
||
func TestRun(t *testing.T) { | ||
err := Run() | ||
if err != nil { | ||
t.Errorf("TestRun failed: %v", err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v3.0.0-alpha.4 | ||
v3.0.0-alpha.4 |