Skip to content

Commit

Permalink
GPT-commit: Refactored lib.class and wyxd.class for efficiency.
Browse files Browse the repository at this point in the history
Modified `lib.class` and `wyxd.class` in the `src/classes` directory to improve efficiency.
  • Loading branch information
hwixley committed Feb 19, 2024
1 parent e671b95 commit 252d707
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
12 changes: 7 additions & 5 deletions src/classes/lib/lib.class
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ lib.csv.query(){

lib.csv.query.one(){
lines=($(lib.csv.query "$1" "$2" "$3"))
if [[ "$OSTYPE" == "darwin"* ]] || [[ "$(ps -o args= -p $$)" = *"zsh"* ]]; then
if sys.os.mac; then
echo "${lines[2]}"
else
echo "${lines[1]}"
Expand All @@ -31,14 +31,16 @@ lib.csv.all(){
continue
fi
IFS=$'\n' scripts=($(lib.csv.query "arg_scripts" "id" "where category_id='$category'"))
if [ "${scripts[1]}" = "" ]; then
if [ sys.os.mac ] && [ "${scripts[2]}" = "" ]; then
continue
elif [ "${scripts[1]}" = "" ]; then
continue
fi
cat=($(lib.csv.query 'arg_categories' 'name' "where id='$category'"))
cat=$(lib.csv.query.one 'arg_categories' 'name' "where id='$category'")
if [ "$type" = "git" ]; then
echo "### ${cat[1]}:"
echo "### ${cat}:"
else
sys.log.h1 "${cat[1]}:"
sys.log.h1 "${cat}:"
fi
for script in "${scripts[@]:1}"; do
if [ "$script" = "" ]; then
Expand Down
4 changes: 2 additions & 2 deletions src/classes/wyxd/wyxd.class
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ wyxd.readme.update() {
echo ""
cp -f "$WYX_DIR/.github/README_TEMPLATE.md" "$WYX_DIR/.github/README.md"
sed -i "s:@VERSION@:$version:g" "$WYX_DIR/.github/README.md"
commands=$(cat "$WYX_DIR/src/data/.cache/cmdinfo.git.wyx" | sed -r "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2};?)?)?[mGK]//g")
echo "$commands" >> "$WYX_DIR/.github/README.md"
wyx_commands=$(cat "$WYX_DIR/src/data/.cache/cmdinfo.git.wyx" | sed -r "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2};?)?)?[mGK]//g")
echo "$wyx_commands" >> "$WYX_DIR/.github/README.md"
sys.log.info "README.md updated successfully!"
}

0 comments on commit 252d707

Please sign in to comment.