Add 'mkdir', and 'install' scripts

This commit is contained in:
0x1eef 2024-09-24 06:56:12 -03:00
parent cd788b4afb
commit 71d41947cc
3 changed files with 34 additions and 11 deletions

View file

@ -28,17 +28,8 @@ fi
if [ -e "${sharebase}"/"${skel}".skeleton ]; then if [ -e "${sharebase}"/"${skel}".skeleton ]; then
target="${sharebase}"/"${skel}".skeleton target="${sharebase}"/"${skel}".skeleton
destdir="$(pwd)"/"${appname}" destdir="$(pwd)"/"${appname}"
cd "${target}" "${libexec}"/scripts/mkdir "${target}" "${destdir}"
find . \ "${libexec}"/scripts/install "${target}" "${destdir}"
-type d \
-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= {} "${destdir}"/"{}" \; \
-exec echo -n . \;
echo
printok "initialized ${appname}" printok "initialized ${appname}"
else else
printerr "skeleton ${skel} was not found" printerr "skeleton ${skel} was not found"

16
libexec/webskel/scripts/install Executable file
View file

@ -0,0 +1,16 @@
#!/bin/sh
set -e
##
# variables
target="${1}"
destdir="${2}"
##
# main
cd "${target}"
find . \
-type f \
-exec install -m u=rwx,g=rx,o= {} "${destdir}"/"{}" \; \
-exec echo -n . \;
echo

16
libexec/webskel/scripts/mkdir Executable file
View file

@ -0,0 +1,16 @@
#!/bin/sh
set -e
##
# variables
target="${1}"
destdir="${2}"
##
# main
cd "${target}"
find . \
-type d \
-exec install -d -m u=rwx,g=rx,o= "${destdir}"/"{}" \; \
-exec echo -n . \;
echo