#!/bin/sh # This file is a part of Julia. License is MIT: https://julialang.org/license # Usage: very similar to `install` # install.sh 755 src1 src2 ... dest setglobal PERMS = $1 shift setglobal ARGS = ''"" while test $Argc -gt 1 { setglobal ARGS = ""$ARGS $1"" shift } setglobal DEST = $1 for SRC in [$ARGS] { cp -a $SRC $DEST if test -d $DEST { setglobal DESTFILE = ""$DEST/$[basename $SRC]"" } else { setglobal DESTFILE = $DEST } # Do the chmod dance, and ignore errors on platforms that don't like setting permissions of symlinks # TODO: Test if it's a symlink instead of having to redirect stderr to /dev/null chmod $PERMS $DESTFILE !2 >/dev/null } exit 0