-
-
Notifications
You must be signed in to change notification settings - Fork 79
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
f068899
commit 2af7814
Showing
4 changed files
with
82 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const os = require('os'); | ||
|
||
const binaries = { | ||
'linux-x64': 'odiff-linux-x64.exe', | ||
'darwin-arm64': 'odiff-macos-arm64.exe', | ||
'darwin-x64': 'odiff-macos-x64.exe', | ||
'win32-x64': 'odiff-windows-x64.exe', | ||
}; | ||
|
||
const platform = os.platform(); | ||
const arch = os.arch(); | ||
|
||
let binaryKey = `${platform}-${arch}`; | ||
if (platform === 'win32' && arch === 'x64') { | ||
binaryKey = 'win32-x64'; | ||
} | ||
|
||
const binaryFile = binaries[binaryKey]; | ||
|
||
if (!binaryFile) { | ||
console.error(`odiff: Sorry your platform or architecture is not supported. Here is a list of supported binaries: ${Object.keys(binaries).join(', ')}`); | ||
process.exit(1); | ||
} | ||
|
||
const sourcePath = path.join(__dirname, 'raw_binaries', binaryFile); | ||
const destPath = path.join(__dirname, 'bin', 'odiff'); | ||
|
||
try { | ||
fs.copyFileSync(sourcePath, destPath); | ||
fs.chmodSync(destPath, 0o755); | ||
} catch (err) { | ||
console.error(`odiff: failed to copy and link the binary file: ${err}`); | ||
process.exit(1); | ||
} |
Empty file.
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,16 @@ | ||
#!/bin/bash | ||
|
||
set -eou pipefail | ||
|
||
VERSION="$1" | ||
if ! git diff --quiet; then | ||
echo "Error: There are unstaged changes in the repository." | ||
exit 1 | ||
fi | ||
|
||
sed -i '' "s/(version [^)]*)/(version $VERSION)/g" dune-project | ||
dune build | ||
|
||
sed -i "s/\"version\": \"[^\"]*\"/\"version\": \"$VERSION\"/g" package.json | ||
npm install | ||
|