-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #106 from JeffersonLab/105-rcdn-has-wrong-path
Fix rcnd executable
- Loading branch information
Showing
5 changed files
with
44 additions
and
10 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 |
---|---|---|
@@ -1,3 +1,15 @@ | ||
#!/bin/sh | ||
#!/usr/bin/env python3 | ||
|
||
/usr/bin/env python3 $RCDB_HOME/python/rcdb/rcdb_cli "$@" | ||
import os | ||
import sys | ||
|
||
# Figure out where is python directory | ||
this_file_dir = os.path.dirname(os.path.abspath(__file__)) | ||
python_dir = os.path.join(this_file_dir, '..', 'python') | ||
|
||
# Add the directory to the Python modules search path | ||
sys.path.insert(0, python_dir) | ||
|
||
# Import and run rcdb | ||
from rcdb.rcdb_cli.app import rcdb_cli | ||
rcdb_cli(prog_name="rcdb") |
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 |
---|---|---|
@@ -1,4 +1,25 @@ | ||
#!/bin/sh | ||
#!/usr/bin/env python3 | ||
|
||
/usr/bin/env python $RCDB_HOME/python/rcdb/rcnd.py "$@" | ||
import os | ||
import sys | ||
import importlib.util | ||
|
||
# Figure out where is rcnd.py located | ||
this_file_dir = os.path.dirname(os.path.abspath(__file__)) | ||
|
||
this_file_dir = os.path.dirname(os.path.abspath(__file__)) | ||
python_dir = os.path.join(this_file_dir, '..', 'python') | ||
|
||
# Add the directory to the Python modules search path | ||
sys.path.insert(0, python_dir) | ||
|
||
module_path = os.path.join(this_file_dir, '..', 'python', 'utilites', 'rcnd.py') | ||
module_path = os.path.abspath(module_path) | ||
|
||
# Load the module from the specified file | ||
spec = importlib.util.spec_from_file_location('rcnd', module_path) | ||
rcnd = importlib.util.module_from_spec(spec) | ||
spec.loader.exec_module(rcnd) | ||
|
||
# Now you can use functions from the module | ||
rcnd.main() |
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