This repository has been archived by the owner on Jun 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjust multi-platform CLI invocation
- Loading branch information
1 parent
3950c85
commit ec95067
Showing
3 changed files
with
29 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import ArduinoCompiler, {InstallInfo} from "./compiler"; | ||
import * as os from "os"; | ||
import * as child_process from "child_process"; | ||
|
||
export class CLI { | ||
|
||
public static run(args?: string[], info?: InstallInfo){ | ||
if(info == undefined){ | ||
info = ArduinoCompiler.checkInstall(); | ||
if(info == null) return; | ||
} | ||
|
||
const command = os.type() == "Windows_NT" | ||
? "arduino-cli.exe" | ||
: "./arduino-cli"; | ||
|
||
return child_process.execFileSync(command, args, { encoding: "utf8", cwd: info.cli }); | ||
} | ||
} |
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