Skip to content

Commit

Permalink
Add croshellj script for enhanced functionality and update lfrc mappings
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Al-Saffar committed Feb 14, 2025
1 parent 6cea7a9 commit 0e5c31a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
17 changes: 17 additions & 0 deletions src/machineconfig/scripts/linux/croshellj
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash


op_script=$HOME/tmp_results/shells/python_return_command.sh
if [ -f "$op_script" ]; then
rm $op_script
fi

source $HOME/scripts/activate_ve 've'

python -m machineconfig.scripts.python.croshell --read "$@"
# python $(dirname $(dirname $0))/python/fire_jobs.py "$@"

# path_container = "$op_script/.py"
# path = echo of path_container
path=$(cat "$op_script.py")
code $path
4 changes: 3 additions & 1 deletion src/machineconfig/scripts/python/croshell.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,16 @@ def build_parser():
ve = get_ve_profile(P(file)) if args.ve is None else str(args.ve)

final_program = f"""
#!/bin/bash
. $HOME/scripts/activate_ve '{ve}'
{interpreter} """
if interpreter == "ipython":
final_program += f"{interactivity} --profile {profile} --no-banner"
final_program += f" {str(pyfile)}"
print(f"🔥 sourcing ... {pyfile}")
# print(f"Running ... {final_program}")
PROGRAM_PATH.write_text(data=final_program)
(PROGRAM_PATH + ".py").write_text(str(pyfile), encoding='utf-8')

# if platform.system() == "Windows":
# return subprocess.run([f"powershell", "-Command", res], shell=True, capture_output=False, text=True, check=True)
Expand Down
1 change: 1 addition & 0 deletions src/machineconfig/settings/lf/linux/lfrc
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ map wr $~/scripts/croshell
map i !~/code/machineconfig/src/machineconfig/settings/lf/linux/exe/previewer.sh $f
map I !cat $f | gum pager
map R $~/scripts/croshell -r $f
map J $~/scripts/croshellj $f


# o file/folder Operations
Expand Down

0 comments on commit 0e5c31a

Please sign in to comment.