From 09a315df8dd4ef07fa40338455c9425eac2cbfec Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Thu, 21 Jun 2018 11:17:45 +1000 Subject: [PATCH] misc: cleanup --- README.md | 19 +++---------------- test.sh | 7 +------ 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 85c623b..0ed710d 100644 --- a/README.md +++ b/README.md @@ -17,24 +17,11 @@ src="https://img.shields.io/badge/license-MIT-blue.svg"> -The goal of this book is to document known and unknown methods of -doing various tasks using only built-in `bash` features. Using the snippets -from this bible can help to remove unneeded dependencies from scripts -and in most cases make them that little bit faster. I came across these -tips and discovered a few while developing -[neofetch](https://github.com/dylanaraps/neofetch), -[pxltrm](https://github.com/dylanaraps/pxltrm) and some other smaller -projects. +The goal of this book is to document known and unknown methods of doing various tasks using only built-in `bash` features. Using the snippets from this bible can help to remove unneeded dependencies from scripts and in most cases make them that little bit faster. I came across these tips and discovered a few while developing [neofetch](https://github.com/dylanaraps/neofetch), [pxltrm](https://github.com/dylanaraps/pxltrm) and some other smaller projects. -The snippets below are linted using `shellcheck` and tests have been -written where applicable. Want to contribute? Have a read of -the -[CONTRIBUTING.md](https://github.com/dylanaraps/pure-bash-bible/blob/master/CONTRIBUTING.md). -It outlines how the unit tests work and what is required when adding -snippets to the bible. +The snippets below are linted using `shellcheck` and tests have been written where applicable. Want to contribute? Have a read of the [CONTRIBUTING.md](https://github.com/dylanaraps/pure-bash-bible/blob/master/CONTRIBUTING.md). It outlines how the unit tests work and what is required when adding snippets to the bible. -See something that is incorrectly described, buggy or outright -wrong? Open an issue or send a pull request. If the bible is missing something, open an issue and a solution will be found. +See something that is incorrectly described, buggy or outright wrong? Open an issue or send a pull request. If the bible is missing something, open an issue and a solution will be found.

This book is also available to purchase on leanpub. https://leanpub.com/bash

diff --git a/test.sh b/test.sh index 37e5d11..787fd63 100755 --- a/test.sh +++ b/test.sh @@ -74,28 +74,24 @@ test_head() { printf '%s\n%s\n\n\n' "hello" "world" > test_file result="$(head 2 test_file)" assert_equals "$result" $'hello\nworld' - rm test_file } test_tail() { printf '\n\n\n%s\n%s\n' "hello" "world" > test_file result="$(tail 2 test_file)" assert_equals "$result" $'hello\nworld' - rm test_file } test_lines() { printf '\n\n\n\n\n\n\n\n' > test_file result="$(lines test_file)" assert_equals "$result" "8" - rm test_file } test_lines_loop() { printf '\n\n\n\n\n\n\n\n' > test_file result="$(lines_loop test_file)" assert_equals "$result" "8" - rm test_file } test_count() { @@ -148,7 +144,6 @@ test_extract() { printf '{\nhello, world\n}\n' > test_file result="$(extract test_file "{" "}")" assert_equals "$result" "hello, world" - rm test_file } test_split() { @@ -170,7 +165,7 @@ assert_equals() { } main() { - trap 'rm readme_code' EXIT + trap 'rm readme_code test_file' EXIT # Extract code blocks from the README. while IFS=$'\n' read -r line; do