2 Commits
v2.0 ... master

Author SHA1 Message Date
eshanized
9af93ae123 🐛 fix: /usr/lib/snigdhaos-assistant/apply.sh: line 6: /var/log/snigdhaos_assistant.log: Permission denied 2025-01-07 22:24:29 +05:30
eshanized
0d71b4b9f9 🧹 chore: remove confirmation 2025-01-07 22:23:16 +05:30

View File

@@ -2,8 +2,12 @@
# Function to log messages to a log file # Function to log messages to a log file
log_message() { log_message() {
# This function logs messages with a timestamp to /var/log/snigdhaos_assistant.log local log_file="/var/log/snigdhaos_assistant.log"
echo "$(date '+%Y-%m-%d %H:%M:%S') - $1" >> /var/log/snigdhaos_assistant.log if [ -w "$log_file" ] || sudo touch "$log_file" 2>/dev/null; then
echo "$(date '+%Y-%m-%d %H:%M:%S') - $1" | sudo tee -a "$log_file" > /dev/null
else
echo "Log file not writable: $log_file"
fi
} }
# Check if the first file (setup script) exists and execute it # Check if the first file (setup script) exists and execute it
@@ -38,7 +42,7 @@ else
# If packages are found, list them and show a package emoji # If packages are found, list them and show a package emoji
echo "📦 The following packages will be installed: $installable_packages" echo "📦 The following packages will be installed: $installable_packages"
log_message "Installing packages: $installable_packages" log_message "Installing packages: $installable_packages"
if ! sudo pacman -S --needed $installable_packages; then if ! sudo pacman -S --needed $installable_packages --noconfirm; then
# If the package installation fails, show an error with a cross emoji # If the package installation fails, show an error with a cross emoji
echo "❌ Error installing packages. Check logs for more details." echo "❌ Error installing packages. Check logs for more details."
log_message "Error installing packages: $installable_packages" log_message "Error installing packages: $installable_packages"