Skip to content

Commit 54e1a77

Browse files
committed
Resolved terminal FOUC, closes #1196. Added debugging for author-nvm bridge.
1 parent de4ee40 commit 54e1a77

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

src/author/bridge.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@ func Bridge(args ...string) {
4646
}
4747

4848
if len(args) < 2 {
49-
fmt.Printf("error: invalid number of arguments passed to author bridge: %d\n", len(args))
50-
os.Exit(1)
49+
if !(len(args) == 1 && args[0] == "version") {
50+
fmt.Printf("error: invalid number of arguments passed to author bridge: %d\n", len(args))
51+
os.Exit(1)
52+
}
5153
}
5254

5355
command := args[0]

src/manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nvm",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"description": "Node.js version manager for Windows",
55
"license": "SEE LICENSE IN LICENSE",
66
"author": "coreybutler",

src/nvm.go

+12-1
Original file line numberDiff line numberDiff line change
@@ -1538,6 +1538,17 @@ func checkLocalEnvironment() {
15381538

15391539
v := node.GetInstalled(env.root)
15401540

1541+
// Make sure author-nvm.exe is available and runs
1542+
exe, _ := os.Executable()
1543+
valueBytes, err := exec.Command(exe, "author", "version").Output()
1544+
authorNvmVersion := "Not Detected"
1545+
if err != nil {
1546+
// fmt.Println("Error running author-nvm.exe: " + err.Error())
1547+
problems = append(problems, "The author-nvm.exe file is missing or not executable.")
1548+
} else {
1549+
authorNvmVersion = strings.TrimSpace(string(valueBytes))
1550+
}
1551+
15411552
nvmhome := os.Getenv("NVM_HOME")
15421553
mirrors := "No mirrors configured"
15431554
if len(env.node_mirror) > 0 && len(env.npm_mirror) > 0 {
@@ -1547,7 +1558,7 @@ func checkLocalEnvironment() {
15471558
} else if len(env.npm_mirror) > 0 {
15481559
mirrors = env.npm_mirror + " (npm)"
15491560
}
1550-
fmt.Printf("\nNVM4W Version: %v\nNVM4W Path: %v\nNVM4W Settings: %v\nNVM_HOME: %v\nNVM_SYMLINK: %v\nNode Installations: %v\nDefault Architecture: %v-bit\nMirrors: %v\nHTTP Proxy: %v\n\nTotal Node.js Versions: %v\nActive Node.js Version: %v", NvmVersion, path, home, nvmhome, symlink, env.root, env.arch, mirrors, env.proxy, len(v), out)
1561+
fmt.Printf("\nNVM4W Version: %v\nNVM4W Author Bridge: %v\nNVM4W Path: %v\nNVM4W Settings: %v\nNVM_HOME: %v\nNVM_SYMLINK: %v\nNode Installations: %v\nDefault Architecture: %v-bit\nMirrors: %v\nHTTP Proxy: %v\n\nTotal Node.js Versions: %v\nActive Node.js Version: %v", NvmVersion, authorNvmVersion, path, home, nvmhome, symlink, env.root, env.arch, mirrors, env.proxy, len(v), out)
15511562

15521563
if !nvmsymlinkfound {
15531564
problems = append(problems, "The NVM4W symlink ("+env.symlink+") was not found in the PATH environment variable.")

0 commit comments

Comments
 (0)