Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
Parman committed Feb 3, 2025
1 parent b9a8b3e commit 4f9dfdb
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
4 changes: 3 additions & 1 deletion run_parmanode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
#comment and not code.

#soucing executes files, and loads functions to the memory, making them available to the program
source ./src/special/do_loop.sh || { echo "unable to source ./src/special/do_loop.sh" && exit ; }
source $HOME/parman_programs/parmanode/src/special/do_loop.sh || {
echo "unable to source $HOME/parman_programs/parmanode/src/special/do_loop.sh" && exit
}
#an error signal returns a non-zero value to the or operator ||, from the left-hand side, and
#triggers execution of the code on the right-hand side.

Expand Down
3 changes: 2 additions & 1 deletion src/debug/nogsedtest.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
function nogsedtest {
! which gsed >$dn ; then touch $dp/.nogsed ; echo "called by ${FUNCNAME[1]}, $(date)" >> $dp/.nogsed ; fi
touch $HOME/.nogsed ; echo "called by ${FUNCNAME[1]}, $(date)" >> $HOME/.nogsed
# if ! which gsed >/dev/null ; then touch $HOME/.nogsed ; echo "called by ${FUNCNAME[1]}, $(date)" >> $HOME/.nogsed ; fi
}
7 changes: 1 addition & 6 deletions src/special/do_loop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,8 @@ deactivate >/dev/null 2>&1
# this program.
done #ends the loop

parmanode_variables $@ #CANNOT USE CUSTOM DEBUG FUNCTION BEFORE THIS"

#make sure gsed works early, but after loading variables.
#The sed command is not consistent between Linux and Mac,
#so I'll always use gsed (works on Mac like sed on Linux) and on Linux, the symlink
#gsed will point to sed, making code easier to write and read.
gsed_symlink
parmanode_variables $@ #CANNOT USE CUSTOM DEBUG FUNCTION BEFORE THIS"

set_colours #just exports variables with colour settings to make it easier to code with colours
#parmanode.conf later may override theme
Expand Down
11 changes: 8 additions & 3 deletions src/text_functions/gsed_symlink.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
function gsed_symlink {

#The sed command is not consistent between Linux and Mac,
#so I'll always use gsed (works on Mac like sed on Linux) and on Linux, the symlink
#gsed will point to sed, making code easier to write and read.

#make a gsed symlink
if [[ $(uname) == Linux ]] && ! which gsed >$dn 2>&1 ; then
if [[ $(uname) == Linux ]] && ! which gsed >/dev/null 2>&1 ; then

sudo ln -s $(which sed) /usr/bin/gsed >$dn 2>&1
sudo ln -s $(which sed) /usr/bin/gsed >/dev/null 2>&1

if ! which gsed >$dn ; then
if ! which gsed >/dev/null ; then

echo -e "\n \r Couldn't get gsed symlink working. You could experience errors.
\r Better call Parman for assistance.
Expand Down

0 comments on commit 4f9dfdb

Please sign in to comment.