Muhammad Herdiansyah 8 éve
szülő
commit
6bde4b5a8f
2 módosított fájl, 3 hozzáadás és 2 törlés
  1. 1 0
      CHANGELOG.md
  2. 2 2
      neofetch

+ 1 - 0
CHANGELOG.md

@@ -91,6 +91,7 @@ Neofetch now has an irc channel at `#neofetch` on Freenode. If you have any ques
 - Removed all `date` usage from `get_install_date()`.
 - Added a new function called `convert_time()` which takes the time stamped `ls` output and converts it to a pretty format. The function only uses bash so its much faster than calling `date`. This makes things simple and keeps the output consistent across all Operating Systems. Example: `2016-12-06 16:58:58.000000000` --> `Tue 06 Dec 2016 4:58 PM`
 - Added an option so users can choose between using 24-hour and 12-hour time format
+- `get_install_date()` will detect which `ls` program is being used instead of hardcoding them per OS.
 
 **Disk**<br \>
 

+ 2 - 2
neofetch

@@ -1764,8 +1764,8 @@ get_install_date() {
     ls_prog="$(ls --version 2>&1)"
     case "$ls_prog" in
         *"BusyBox"*) install_date="$(ls -tdce "$install_file" | awk '{printf $10 " " $7 " " $8 " " $9}')" ;;
-        *"crtime"*) install_date="$(ls -tdcE "$install_file" | awk '{printf $6 " " $7}')" ;;
-        *"ACFHLRSZ"*) install_date="$(ls -dl "$install_file" | awk '{printf $6 " " $7}')" ;;
+        *"crtime"*) install_date="$(ls -tdcE "$install_file" | awk '{printf $6 " " $7}')" ;; # xpg4 (Solaris)
+        *"ACFHLRSZ"*) install_date="$(ls -dl "$install_file" | awk '{printf $6 " " $7}')" ;; # Toybox
         *"GNU coreutils"*) install_date="$(ls -tcd --full-time "$install_file" | awk '{printf $6 " " $7}')" ;;
         *) install_date="$(ls -dlctT "$install_file" | awk '{printf $9 " " $6 " "$7 " " $8}')" ;;
     esac