From 1c80d1397b5912417ff1914356441dce0f839c7c Mon Sep 17 00:00:00 2001 From: 0x1eef <0x1eef@protonmail.com> Date: Sun, 22 Sep 2024 19:08:35 -0300 Subject: [PATCH] Add "destdir" --- libexec/webskel/commands/new | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libexec/webskel/commands/new b/libexec/webskel/commands/new index aad1231..5897e85 100755 --- a/libexec/webskel/commands/new +++ b/libexec/webskel/commands/new @@ -8,6 +8,8 @@ sharebase="${localbase}"/share/webskel libexec="${localbase}"/libexec/webskel appname="${1}" skel="${2}" +target= +destdir= ## # functions @@ -25,16 +27,16 @@ if [ -z "${skel}" ]; then fi if [ -e "${sharebase}"/"${skel}".skeleton ]; then target="${sharebase}"/"${skel}".skeleton - cwd=$(pwd) - cd ${target} + destdir="$(pwd)"/"${appname}" + cd "${target}" find . \ -type d \ - -exec install -d -m u=rwx,g=rx,o= "${cwd}"/"${appname}"/"{}" \; \ + -exec install -d -m u=rwx,g=rx,o= "${destdir}"/"{}" \; \ -exec echo -n . \; echo find . \ -type f \ - -exec install -m u=rwx,g=rx,o= {} "${cwd}"/"${appname}"/"{}" \; \ + -exec install -m u=rwx,g=rx,o= {} "${destdir}"/"{}" \; \ -exec echo -n . \; echo printok "initialized ${app}"