Skip to content

Commit

Permalink
Fix CLI working without an extension (#183)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Salinas <[email protected]>
  • Loading branch information
zzorba and Daniel Salinas authored Dec 10, 2024
1 parent 17285ee commit 28ec914
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 15 deletions.
10 changes: 0 additions & 10 deletions bin/cli

This file was deleted.

3 changes: 2 additions & 1 deletion bin/cli.cjs
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env node
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
Expand Down Expand Up @@ -32,7 +33,7 @@ const rootDir = getRootDir();

const args = process.argv.slice(2);
if (args.length === 1 && args[0] === "--path") {
console.log(`${rootDir}/bin/cli`);
console.log(`${rootDir}/bin/cli.cjs`);
process.exit(0);
}

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"type": "module",
"main": "./typescript/src/index.ts",
"bin": {
"ubrn": "./bin/cli",
"uniffi-bindgen-react-native": "./bin/cli"
"ubrn": "./bin/cli.cjs",
"uniffi-bindgen-react-native": "./bin/cli.cjs"
},
"scripts": {
"test": "./scripts/run-tests.sh"
Expand Down
2 changes: 1 addition & 1 deletion scripts/run-checkout-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

ubrn=./bin/cli
ubrn=./bin/cli.cjs

function clean_up {
rm -rf rust_modules
Expand Down
2 changes: 1 addition & 1 deletion scripts/test-turbo-modules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ find_git_project_root() {

derive_paths() {
ROOT=$(find_git_project_root)
UBRN_BIN="$ROOT/bin/cli"
UBRN_BIN="$ROOT/bin/cli.cjs"
PWD=$(pwd)
}

Expand Down

0 comments on commit 28ec914

Please sign in to comment.