Skip to content

Commit

Permalink
Improve function to remove snip lines
Browse files Browse the repository at this point in the history
  • Loading branch information
whoan committed Nov 7, 2019
1 parent d077c25 commit f3b5674
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions snip.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env bash

__snip__remove_snip_line() {
__snip__remove_snip_lines() {
local source_file
source_file="${1:?Missing source file as param}"
sed "/^[ \t]*snip/d" "$source_file"
sed "/snip(/d" "$source_file"
}


Expand Down Expand Up @@ -78,7 +78,7 @@ __snip__replace_snips() {

local output_file=${prefix_tmp}${extension}
rm "$prefix_tmp"
__snip__remove_snip_line "$source_file" > "$output_file"
__snip__remove_snip_lines "$source_file" > "$output_file"
rm "$prefix_tmp"-*

echo "$output_file"
Expand Down

0 comments on commit f3b5674

Please sign in to comment.