save point

This commit is contained in:
kake26 2025-05-12 14:35:28 -05:00
parent 4c8b2b9c3b
commit 5b83c89d4a
Signed by: kake26
GPG key ID: E0A989B571D1F99F
9 changed files with 128 additions and 41 deletions

View file

@ -1,7 +0,0 @@
[section]
key=newvalue
key2=fuck this
[newsection]
key=newvalue

View file

@ -1,6 +0,0 @@
{
"bashini": "new",
"section": {
"key": "beer"
}
}

33
modules/filen.bash Normal file
View file

@ -0,0 +1,33 @@
#!/usr/bin/env bash
# Filen module for lactozora framework
# Requires filen-cli to be installed and authenticated
filen_upload() {
local file_path="$1"
local remote_path="$2"
if [[ ! -f "$file_path" ]]; then
echo "Error: File $file_path does not exist" >&2
return 1
fi
if ! command -v filen &> /dev/null; then
echo "Error: filen-cli is not installed" >&2
return 1
fi
filen upload "$file_path" "$remote_path"
}
filen_download() {
local remote_path="$1"
local local_path="$2"
if ! command -v filen &> /dev/null; then
echo "Error: filen-cli is not installed" >&2
return 1
fi
filen download "$remote_path" "$local_path"
}

21
modules/header.bash Normal file
View file

@ -0,0 +1,21 @@
#!/bin/bash
# this is the main script template
set -eo pipefail #these can cause problems when you want stuff to keep going
if [[ -n "${BASHD_DEBUG}" ]]; then # a inevitability that this will be used
set -x
fi
trap cleanup EXIT # A little more robust cleanup
# trap errors and set the ERR trap
trap 'echo -e "\nERROR: $BASH_COMMAND\nFILE: ${BASH_SOURCE[0]}\nLINE: ${BASH_LINENO[0]}\n" >&2; exit 1' ERR
cleanup() {
# We can clean up any temp files or what nots, but for now a place holder
true
}
source ./modules/config_json.bash

39
modules/init_project.bash Normal file
View file

@ -0,0 +1,39 @@
#!/bin/bash
# Function to initialize a new project
init_project() {
if [ -z "$1" ]; then
echo "Usage: init_project <project_name>"
return 1
fi
PROJECT_NAME=$1
PROJECT_DIR="${PWD}/${PROJECT_NAME}"
# Create project directory structure
mkdir -p "${PROJECT_DIR}"/{src,modules,tests,docs}
# Create basic files
touch "${PROJECT_DIR}"/README.md
touch "${PROJECT_DIR}"/main.bash
chmod +x "${PROJECT_DIR}"/main.bash
cp -r modules "${PROJECT_DIR}"
# Populate README with basic content
echo "# ${PROJECT_NAME}" >> "${PROJECT_DIR}"/README.md
echo "" >> "${PROJECT_DIR}"/README.md
echo "This is a new project created using the lactozora framework." >> "${PROJECT_DIR}"/README.md
# Add basic template to main.bash
echo "#!/bin/bash" >> "${PROJECT_DIR}"/main.bash
echo "" >> "${PROJECT_DIR}"/main.bash
echo "# Main script for ${PROJECT_NAME}" >> "${PROJECT_DIR}"/main.bash
echo "source ./modules/header.bash" >> "${PROJECT_DIR}"/main.bash
echo "" >> "${PROJECT_DIR}"/main.bash
echo "# Add your code here" >> "${PROJECT_DIR}"/main.bash
echo "" >> "${PROJECT_DIR}"/main.bash
echo "# End of main script" >> "${PROJECT_DIR}"/main.bash
echo "" >> "${PROJECT_DIR}"/main.bash
echo "Project '${PROJECT_NAME}' initialized successfully in ${PROJECT_DIR}"
}

View file

@ -18,7 +18,8 @@ tmux_capture_pane() {
# List all available tmux panes
tmux_list_panes() {
tmux list-panes -F "#{window_id} #{pane_id} #{pane_title} #{pane_current_command}"
#tmux list-panes -F "#{window_id} #{pane_id} #{pane_title} #{pane_current_command}"
tmux list-panes -a -F "#{session_name}:#{window_index}.#{pane_index} - #{pane_current_command}"
}
tmux_list_windows() {