mirror of
https://github.com/Snigdha-OS/snigdhaos-assistant.git
synced 2025-12-06 16:13:55 +01:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9af93ae123 | ||
|
|
0d71b4b9f9 |
@@ -2,8 +2,12 @@
|
||||
|
||||
# Function to log messages to a log file
|
||||
log_message() {
|
||||
# This function logs messages with a timestamp to /var/log/snigdhaos_assistant.log
|
||||
echo "$(date '+%Y-%m-%d %H:%M:%S') - $1" >> /var/log/snigdhaos_assistant.log
|
||||
local log_file="/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
|
||||
@@ -38,7 +42,7 @@ else
|
||||
# If packages are found, list them and show a package emoji
|
||||
echo "📦 The following packages will be installed: $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
|
||||
echo "❌ Error installing packages. Check logs for more details."
|
||||
log_message "Error installing packages: $installable_packages"
|
||||
|
||||
Reference in New Issue
Block a user