Skip to content

Commit

Permalink
Updated CLI build package (for better linux support)
Browse files Browse the repository at this point in the history
  • Loading branch information
PicoCreator committed May 28, 2019
1 parent 9ee8d05 commit 12eea36
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
Binary file renamed bin/uilicious-cli → bin/uilicious-linux
Binary file not shown.
Binary file added bin/uilicious-macos
Binary file not shown.
File renamed without changes.
22 changes: 13 additions & 9 deletions uilicious-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ const scriptDirectory = __dirname;

// Mapping from Node's `process.arch` to Golang's `$GOARCH`
const ARCH_MAPPING = {
"ia32": "386",
"x64": "amd64",
"arm": "arm"
"ia32": "386",
"x64": "amd64",
// "arm": "arm"
};

// Mapping between Node's `process.platform` to Golang's
const PLATFORM_MAPPING = {
"darwin": "darwin",
"linux": "linux",
"win32": "windows"
"darwin": "darwin",
"linux": "linux",
"win32": "windows"
};

if (!(process.arch in ARCH_MAPPING)) {
Expand All @@ -46,9 +46,13 @@ if (!(process.platform in PLATFORM_MAPPING)) {

// Get the bin executable path
// Binary name on Windows has .exe suffix
var binName = path.join(scriptDirectory, "/bin/uilicious-cli");
if (process.platform === "win32") {
binName += ".exe"
var binName = null
if(process.platform === "darwin") {
binName = path.join(scriptDirectory, "/bin/uilicious-macos");
} else if(process.platform === "win32") {
binName = path.join(scriptDirectory, "/bin/uilicious-windows.exe");
} else if(process.platform === "linux") {
binName = path.join(scriptDirectory, "/bin/uilicious-linux");
}

// Execute the binary file, and pass forward the arguments
Expand Down

0 comments on commit 12eea36

Please sign in to comment.