ezbuild/libraries/filesystem

33 lines
1.0 KiB
Plaintext
Raw Normal View History

2012-01-02 12:40:32 +01:00
#!/bin/bash
# Copyright 2010-2011, Asio Software Technologies
# Distributed under the terms of the GNU General Public License v3
#-------------------------------------------------------------------------------
# Creates all components of the specified directories
# Parameters: %directory%
#-------------------------------------------------------------------------------
function makeDirectory() {
2012-01-02 13:06:07 +01:00
local OUTPUT=$(install -d "${@}" 2>&1)
local RESULT=${?}
2012-01-02 12:40:32 +01:00
if [[ ${RESULT} -ne 0 ]]; then
logOutput "${OUTPUT}"
fi
return ${RESULT}
}
#-------------------------------------------------------------------------------
# Creates a symbolic link between to files in specified target directory
# Parameters: %source% %target%
#-------------------------------------------------------------------------------
function makeLink() {
2012-01-02 13:06:07 +01:00
local DESTDIR="${2%/*}"
2012-01-02 12:40:32 +01:00
[[ ! -d ${DESTDIR} ]] && makeDirectory "${DESTDIR}"
2012-01-02 13:06:07 +01:00
local OUTPUT=$(ln -sfn "${1}" "${2}" 2>&1)
local RESULT=${?}
2012-01-02 12:40:32 +01:00
if [[ ${RESULT} -ne 0 ]]; then
logOutput "${OUTPUT}"
fi
return ${RESULT}
}