Compare commits

..

11 Commits
tests ... 4.0.2

Author SHA1 Message Date
Dylan Araps
c9bda1dd09 docs: update 2018-05-20 07:56:46 +10:00
Dylan Araps
c814f14726 general: Fix issues with default config. 2018-05-19 20:38:45 +10:00
Dylan Araps
992d0b38ae general: Added --print_config to display the default config file. 2018-05-19 08:28:10 +10:00
Dylan Araps
c782af6a06 Merge branch 'master' of github.com:dylanaraps/neofetch 2018-05-19 08:06:22 +10:00
Dylan Araps
80299bd064 macOS: Fix xquartz issue. 2018-05-19 08:06:05 +10:00
Dylan Araps
c69e5ef041 docs: update 2018-05-18 16:26:22 +10:00
Dylan Araps
19d35b995d docs: update 2018-05-18 16:25:46 +10:00
Dylan Araps
0e43d765fa docs: update 2018-05-18 16:14:04 +10:00
Dylan Araps
8b4c858042 Merge pull request #993 from dylanaraps/pkg_clean
packages: cleanup
2018-05-18 06:10:38 +00:00
Dylan Araps
98252472ce general: Fix default config in bash3. 2018-05-18 16:11:00 +10:00
Dylan Araps
6e41d5e0a9 packages: cleanup 2018-05-18 15:49:14 +10:00
7 changed files with 106 additions and 137 deletions

View File

@@ -20,4 +20,3 @@ script:
# Check for lines longer than 100 chars.
# There are 3 lines that must be longer than 100 chars.
- if (("$(grep '.\{101\}' neofetch | wc -l)" > 3)); then (exit 1); else (exit 0); fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cd tests && ./test.sh; fi

View File

@@ -7,9 +7,25 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [Unreleased]
- [config] Fixed `/dev/stdin` error.
- [config] Added `--print_config` to display the default config file.
- [macOS] Fixed xquartz issue.
## [4.0.1] - 2018-05-18
### Note: This release is only required for those running `bash <3.3`.
- [config] Fixed issue with default config in bash3.
- [packages] Simplified code.
- [term] Fixed macOS issue.
- [term] Fixed `tmux` issue.
## [4.0.0] - 2018-05-17
<h1><img src="https://i.imgur.com/JFxwJtU.png" alt="logo" height="100px"></h1>
This release bumps the version number up to `4.0.0` as it contains major
changes to how Neofetch is packaged and installed.
@@ -2658,7 +2674,8 @@ Changelog:
Let me know if you're having issues.
[Unreleased]: https://github.com/dylanaraps/neofetch/compare/4.0.0...HEAD
[Unreleased]: https://github.com/dylanaraps/neofetch/compare/4.0.1...HEAD
[4.0.1]: https://github.com/dylanaraps/neofetch/compare/4.0.0...4.0.1
[4.0.0]: https://github.com/dylanaraps/neofetch/compare/3.4.0...4.0.0
[3.4.0]: https://github.com/dylanaraps/neofetch/compare/3.3.0...3.4.0
[3.3.0]: https://github.com/dylanaraps/neofetch/compare/3.2.0...3.3.0

View File

@@ -27,7 +27,7 @@
# SOFTWARE.
# Neofetch version.
version="4.0.1"
version="4.0.2"
bash_version="${BASH_VERSION/.*}"
sys_locale="${LANG:-C}"
@@ -826,12 +826,6 @@ image_host="teknik"
# Default: 'off'
# Values: 'on', 'off'
stdout="off"
# Config version.
#
# NOTE: Don't change this value, neofetch reads this to determine
# how to handle backwards compatibility.
config_version="4.0.1"
EOF
# DETECT INFORMATION
@@ -1303,83 +1297,83 @@ get_packages() {
packages="$(pacman -Qq --color never | wc -l)"
type -p dpkg >/dev/null && \
packages="$((packages+=$(dpkg --get-selections | grep -cv deinstall$)))"
((packages+=$(dpkg --get-selections | grep -cv deinstall$)))
type -p pkgtool >/dev/null && \
packages="$((packages+=$(ls -1 /var/log/packages | wc -l)))"
((packages+=$(ls -1 /var/log/packages | wc -l)))
type -p rpm >/dev/null && \
packages="$((packages+=$(rpm -qa | wc -l)))"
((packages+=$(rpm -qa | wc -l)))
type -p xbps-query >/dev/null && \
packages="$((packages+=$(xbps-query -l | wc -l)))"
((packages+=$(xbps-query -l | wc -l)))
type -p pkginfo >/dev/null && \
packages="$((packages+=$(pkginfo -i | wc -l)))"
((packages+=$(pkginfo -i | wc -l)))
type -p emerge >/dev/null && \
packages="$((packages+=$(ls -d /var/db/pkg/*/* | wc -l)))"
((packages+=$(ls -d /var/db/pkg/*/* | wc -l)))
type -p nix-env >/dev/null && \
packages="$((packages+=$(ls -d -1 /nix/store/*/ | wc -l)))"
((packages+=$(ls -d -1 /nix/store/*/ | wc -l)))
type -p guix >/dev/null && \
packages="$((packages+=$(ls -d -1 /gnu/store/*/ | wc -l)))"
((packages+=$(ls -d -1 /gnu/store/*/ | wc -l)))
type -p apk >/dev/null && \
packages="$((packages+=$(apk info | wc -l)))"
((packages+=$(apk info | wc -l)))
type -p opkg >/dev/null && \
packages="$((packages+=$(opkg list-installed | wc -l)))"
((packages+=$(opkg list-installed | wc -l)))
type -p pacman-g2 >/dev/null && \
packages="$((packages+=$(pacman-g2 -Q | wc -l)))"
((packages+=$(pacman-g2 -Q | wc -l)))
type -p lvu >/dev/null && \
packages="$((packages+=$(lvu installed | wc -l)))"
((packages+=$(lvu installed | wc -l)))
type -p tce-status >/dev/null && \
packages="$((packages+=$(tce-status -i | wc -l)))"
((packages+=$(tce-status -i | wc -l)))
type -p Compile >/dev/null && \
packages="$((packages+=$(ls -d -1 /Programs/*/ | wc -l)))"
((packages+=$(ls -d -1 /Programs/*/ | wc -l)))
type -p eopkg >/dev/null && \
packages="$((packages+=$(ls -1 /var/lib/eopkg/package | wc -l)))"
((packages+=$(ls -1 /var/lib/eopkg/package | wc -l)))
type -p pkg_info >/dev/null && \
packages="$((packages+=$(pkg_info | wc -l)))"
((packages+=$(pkg_info | wc -l)))
type -p crew >/dev/null && \
packages="$((packages+=$(ls -l /usr/local/etc/crew/meta/*.filelist | wc -l)))"
((packages+=$(ls -l /usr/local/etc/crew/meta/*.filelist | wc -l)))
type -p tazpkg >/dev/null && \
packages="$((packages+=$(tazpkg list | wc -l) - 6))"
((packages+=$(tazpkg list | wc -l) - 6))
type -p sorcery >/dev/null && \
packages="$((packages+=$(gaze installed | wc -l)))"
((packages+=$(gaze installed | wc -l)))
type -p alps >/dev/null && \
packages="$((packages+=$(alps showinstalled | wc -l)))"
((packages+=$(alps showinstalled | wc -l)))
type -p kpt >/dev/null && \
type -p kpm >/dev/null && \
packages="$((packages+=$(kpm --get-selections | grep -cv deinstall$)))"
((packages+=$(kpm --get-selections | grep -cv deinstall$)))
if type -p cave >/dev/null; then
package_dir=(/var/db/paludis/repositories/{cross-installed/*,installed}/data/*)
packages="$((packages+=$(ls -d -1 "${package_dir[@]}" | wc -l)))"
((packages+=$(ls -d -1 "${package_dir[@]}" | wc -l)))
fi
type -p butch >/dev/null && \
packages="$((packages+=$(butch list | wc -l)))"
((packages+=$(butch list | wc -l)))
if type -p pkg >/dev/null; then
case "$kernel_name" in
"FreeBSD") packages="$((packages+=$(pkg info | wc -l)))" ;;
"FreeBSD") ((packages+=$(pkg info | wc -l))) ;;
*)
packages="$((packages+=$(ls -1 /var/db/pkg | wc -l)))"
((packages == 0)) && packages="$((packages+=$(pkg list | wc -l)))"
((packages+=$(ls -1 /var/db/pkg | wc -l)))
((packages == 0)) && ((packages+=$(pkg list | wc -l)))
esac
fi
;;
@@ -1389,13 +1383,13 @@ get_packages() {
packages="$(($(ls -l /usr/local/bin/ | grep -cv "\(../Cellar/\|brew\)") - 1))"
type -p port >/dev/null && \
packages="$((packages + $(port installed | wc -l) - 1))"
((packages+=$(port installed | wc -l) - 1))
type -p brew >/dev/null && \
packages="$((packages + $(find /usr/local/Cellar -maxdepth 1 | wc -l) - 1))"
((packages+=$(find /usr/local/Cellar -maxdepth 1 | wc -l) - 1))
type -p pkgin >/dev/null && \
packages="$((packages + $(pkgin list | wc -l)))"
((packages+=$(pkgin list | wc -l)))
;;
"Windows")
@@ -1406,7 +1400,7 @@ get_packages() {
# Count chocolatey packages.
[[ -d "/cygdrive/c/ProgramData/chocolatey/lib" ]] && \
packages="$((packages+=$(ls -1 /cygdrive/c/ProgramData/chocolatey/lib | wc -l)))"
((packages+=$(ls -1 /cygdrive/c/ProgramData/chocolatey/lib | wc -l)))
;;
"Haiku")
@@ -1415,7 +1409,7 @@ get_packages() {
"AIX")
packages="$(lslpp -J -l -q | grep -cv '^#')"
packages="$((packages+=$(rpm -qa | wc -l)))"
((packages+=$(rpm -qa | wc -l)))
;;
"IRIX")
@@ -1424,7 +1418,7 @@ get_packages() {
"FreeMiNT")
type -p rpm >/dev/null && \
packages="$((packages+=$(rpm -qa | wc -l)))"
packages="$(rpm -qa | wc -l)"
;;
esac
@@ -3692,6 +3686,11 @@ get_term_size() {
term_width="${term_size[2]/t*}"
fi
# If the sequences above don't work and the user is on a macOS system
# or a system not running an X server, return early.
[[ -z "$DISPLAY" || "$os" == "Mac OS X" ]] && \
{ term_width=0; return; }
# Get terminal width/height if \e[14t is unsupported.
if [[ -z "$term_width" ]] || (( "$term_width" < 50 )); then
if type -p xdotool >/dev/null 2>&1; then
@@ -4815,6 +4814,7 @@ SCREENSHOT:
OTHER:
--config /path/to/config Specify a path to a custom config file
--config none Launch the script without a config file
--print_config Print the default config file to stdout.
--stdout Turn off all colors and disables any ASCII/image backend.
--help Print this text and exit
--version Show neofetch version
@@ -5007,6 +5007,7 @@ get_args() {
;;
"--stdout") stdout="on" ;;
"-v") verbose="on" ;;
"--print_config") printf "%s\\n" "$config"; exit ;;
"-vv") set -x; verbose="on" ;;
"--help") usage ;;
"--version")
@@ -8679,7 +8680,7 @@ main() {
get_os
# Load default config.
source /dev/stdin < <(printf "%s\n" "$config")
eval "$config"
get_args "$@"
[[ "$verbose" != "on" ]] && exec 2>/dev/null
@@ -8713,7 +8714,6 @@ main() {
# Add neofetch info to verbose output.
err "Neofetch command: $0 $*"
err "Neofetch version: $version"
err "Neofetch config: $config_version"
# Show error messages.
[[ "$verbose" == "on" ]] && printf "%b" "$err" >&2
@@ -8724,4 +8724,4 @@ main() {
return 0
}
[[ "$0" == "${BASH_SOURCE[0]}" ]] && main "$@"
main "$@"

View File

@@ -1,5 +1,5 @@
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.6.
.TH NEOFETCH "1" "May 2018" "Neofetch 4.0.1" "User Commands"
.TH NEOFETCH "1" "May 2018" "Neofetch 4.0.2" "User Commands"
.SH NAME
Neofetch \- A fast, highly customizable system info script
.SH SYNOPSIS
@@ -326,6 +326,9 @@ Specify a path to a custom config file
\fB\-\-config\fR none
Launch the script without a config file
.TP
\fB\-\-print_config\fR
Print the default config file to stdout.
.TP
\fB\-\-stdout\fR
Turn off all colors and disables any ASCII/image backend.
.TP

View File

@@ -1,7 +0,0 @@
#!/usr/bin/env bash
#
# Run all tests.
./test_misc.sh
[[ -f /tmp/err ]] || exit 0 && { rm /tmp/err; exit 1; }

View File

@@ -1,32 +0,0 @@
#!/usr/bin/env bash
#
# Test misc functions.
source test_util.sh
source ../neofetch
# Tests only work on Linux for now.
os="Linux"
test_convert_time() {
# 24 hour time.
result="$(convert_time "2016" "04" "14" "23:50")"
assert_equals "$result" "Thu 14 Apr 2016 23:50"
# 12 hour time.
install_time_format="12h"
result="$(convert_time "2016" "04" "14" "23:50")"
assert_equals "$result" "Thu 14 Apr 2016 11:50 PM"
}
test_get_ppid() {
result="$(trim "$(get_ppid "1")")"
assert_equals "$result" "0"
}
printf "%s\\n" "Test MISC functions."
test_convert_time
test_get_ppid

View File

@@ -1,11 +0,0 @@
#!/usr/bin/env bash
#
# Test util functions.
assert_equals() {
# Test equality.
local status
[[ "$1" == "$2" ]] && status="✔"
printf "%s\\n" " ${status:-} : ${FUNCNAME[1]}"
[[ "$1" == "$2" ]] || { :>/tmp/err; return 1; } && return 0
}