Skip to content

Commit

Permalink
Fix loading bin files without an absolute path
Browse files Browse the repository at this point in the history
  • Loading branch information
nitanmarcel committed Sep 10, 2024
1 parent a7ed802 commit 4843d1a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def is_valid_file(parser, arg):

def main():
parser = argparse.ArgumentParser()
parser.add_argument("bin", nargs="?", type=str)
parser.add_argument("bin", nargs="?", type=lambda x: os.path.join(os.environ["R2AI_DIR"], x))
parser.add_argument("-w", "--webserver", action="store_true",
help="Start the r2ai webserver. Same as r2ai -c=-w")
parser.add_argument("-c", "--command", action="append",
Expand Down
3 changes: 2 additions & 1 deletion r2ai.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
unset DYLD_LIBRARY_PATH
unset LD_LIBRARY_PATH
PYTHON=python3
R2AI_DIR="$(pwd)"
if [ -h "$0" ]; then
F=`readlink $0`
else
Expand All @@ -17,4 +18,4 @@ else
. venv/bin/activate
fi
# export PYTHONPATH=$PWD
$PYTHON $D/main.py $@
env R2AI_DIR="$R2AI_DIR" $PYTHON $D/main.py $@

0 comments on commit 4843d1a

Please sign in to comment.