Revert "Multiple fixes: pathname handling" #2
+7
-14
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/sh
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
#
|
#
|
||||||
# Simple script for the terminal that mimics the operation of AdvancedNewFile (Vim plugin)
|
# Simple script for the terminal that mimics the operation of AdvancedNewFile (Vim plugin)
|
||||||
@@ -7,16 +7,9 @@
|
|||||||
# License: MIT
|
# License: MIT
|
||||||
#
|
#
|
||||||
|
|
||||||
|
if [[ "$@" == */ ]]; then
|
||||||
for f in "$@"
|
mkdir -p $@
|
||||||
do
|
else
|
||||||
dir="${f%/*}"
|
for f in "$@"; do mkdir -p "$(dirname "$f")"; done
|
||||||
file="${f##*/}"
|
touch "$@"
|
||||||
|
fi
|
||||||
if [ -n "$dir" ]; then
|
|
||||||
mkdir -p "$dir"
|
|
||||||
fi
|
|
||||||
if [ -n "$file" ]; then
|
|
||||||
touch "./$dir/$file"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|||||||
Reference in New Issue
Block a user