mirror of
https://github.com/natelandau/shell-scripting-templates.git
synced 2025-11-08 13:13:47 -05:00
_parseFilename_: don't require file exists
This commit is contained in:
@@ -189,12 +189,6 @@ _testListFiles_() {
|
|||||||
|
|
||||||
_testParseFilename_() {
|
_testParseFilename_() {
|
||||||
|
|
||||||
@test "_parseFilename_: fail with no file" {
|
|
||||||
run _parseFilename_ "somenonexistantfile"
|
|
||||||
assert_failure
|
|
||||||
assert_output --partial "Can't locate a file to parse"
|
|
||||||
}
|
|
||||||
|
|
||||||
@test "_parseFilename_: file with one extension" {
|
@test "_parseFilename_: file with one extension" {
|
||||||
|
|
||||||
touch "testfile.txt"
|
touch "testfile.txt"
|
||||||
|
|||||||
@@ -157,11 +157,6 @@ _parseFilename_() {
|
|||||||
|
|
||||||
local fileToParse="${1}"
|
local fileToParse="${1}"
|
||||||
|
|
||||||
[[ -f ${fileToParse} ]] || {
|
|
||||||
error "Can't locate a file to parse at: ${fileToParse}"
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
|
|
||||||
PARSE_FULL="$(realpath "${fileToParse}")" \
|
PARSE_FULL="$(realpath "${fileToParse}")" \
|
||||||
&& debug "\${PARSE_FULL}: ${PARSE_FULL:-}"
|
&& debug "\${PARSE_FULL}: ${PARSE_FULL:-}"
|
||||||
PARSE_BASE=$(basename "${fileToParse}") \
|
PARSE_BASE=$(basename "${fileToParse}") \
|
||||||
|
|||||||
Reference in New Issue
Block a user