Revert "Multiple fixes: pathname handling" #2

Merged
tanrax merged 1 commits from revert-1-patch-2 into master 2017-12-20 08:19:34 +01:00
+6 -13
View File
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
#
# Simple script for the terminal that mimics the operation of AdvancedNewFile (Vim plugin)
@@ -7,16 +7,9 @@
# License: MIT
#
for f in "$@"
do
dir="${f%/*}"
file="${f##*/}"
if [ -n "$dir" ]; then
mkdir -p "$dir"
if [[ "$@" == */ ]]; then
mkdir -p $@
else
for f in "$@"; do mkdir -p "$(dirname "$f")"; done
touch "$@"
fi
if [ -n "$file" ]; then
touch "./$dir/$file"
fi
done