mirror of
https://github.com/hauler-dev/hauler.git
synced 2026-02-14 09:59:50 +00:00
updated variables based on feedback
This commit is contained in:
@@ -13,7 +13,7 @@ func New() *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "hauler",
|
||||
Short: "Airgap Swiss Army Knife",
|
||||
Example: " View the Docs: https://docs.hauler.dev\n Environment Variables: HAULER_DIR | HAULER_TEMP_DIR",
|
||||
Example: " View the Docs: https://docs.hauler.dev\n Environment Variables: HAULER_HOME | HAULER_TEMP",
|
||||
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
|
||||
l := log.FromContext(cmd.Context())
|
||||
l.SetLevel(ro.LogLevel)
|
||||
|
||||
@@ -31,7 +31,7 @@ func LoadCmd(ctx context.Context, o *flags.LoadOpts, archiveRefs ...string) erro
|
||||
// unarchiveLayoutTo accepts an archived oci layout and extracts the contents to an existing oci layout, preserving the index
|
||||
func unarchiveLayoutTo(ctx context.Context, archivePath string, dest string, tempOverride string) error {
|
||||
if tempOverride == "" {
|
||||
tempOverride = os.Getenv("HAULER_TEMP_DIR")
|
||||
tempOverride = os.Getenv("HAULER_TEMP")
|
||||
}
|
||||
|
||||
tempDir, err := os.MkdirTemp(tempOverride, "hauler")
|
||||
|
||||
18
install.sh
18
install.sh
@@ -18,8 +18,8 @@
|
||||
# - HAULER_INSTALL_DIR=/usr/local/bin ./install.sh
|
||||
#
|
||||
# Set Hauler Directory
|
||||
# - curl -sfL https://get.hauler.dev | HAULER_DIR=$HOME/.hauler bash
|
||||
# - HAULER_DIR=$HOME/.hauler ./install.sh
|
||||
# - curl -sfL https://get.hauler.dev | HAULER_HOME=$HOME/.hauler bash
|
||||
# - HAULER_HOME=$HOME/.hauler ./install.sh
|
||||
#
|
||||
# Debug Usage:
|
||||
# - curl -sfL https://get.hauler.dev | HAULER_DEBUG=true bash
|
||||
@@ -87,7 +87,7 @@ if [ "${HAULER_UNINSTALL}" = "true" ]; then
|
||||
rm -rf "${HAULER_INSTALL_DIR}/hauler" || fatal "Failed to Remove Hauler from ${HAULER_INSTALL_DIR}"
|
||||
|
||||
# remove the hauler directory
|
||||
rm -rf "${HAULER_DIR}" || fatal "Failed to Remove Hauler Directory: ${HAULER_DIR}"
|
||||
rm -rf "${HAULER_HOME}" || fatal "Failed to Remove Hauler Directory: ${HAULER_HOME}"
|
||||
|
||||
info "Successfully Uninstalled Hauler" && echo
|
||||
exit 0
|
||||
@@ -133,7 +133,7 @@ case $ARCH in
|
||||
esac
|
||||
|
||||
# set hauler directory from argument or environment variable
|
||||
HAULER_DIR=${HAULER_DIR:-$HOME/.hauler}
|
||||
HAULER_HOME=${HAULER_HOME:-$HOME/.hauler}
|
||||
|
||||
# start hauler installation
|
||||
info "Starting Installation..."
|
||||
@@ -143,18 +143,18 @@ verbose "- Version: v${HAULER_VERSION}"
|
||||
verbose "- Platform: ${PLATFORM}"
|
||||
verbose "- Architecture: ${ARCH}"
|
||||
verbose "- Install Directory: ${HAULER_INSTALL_DIR}"
|
||||
verbose "- Hauler Directory: ${HAULER_DIR}"
|
||||
verbose "- Hauler Directory: ${HAULER_HOME}"
|
||||
|
||||
# ensure hauler directory exists and/or create it
|
||||
if [ ! -d "${HAULER_DIR}" ]; then
|
||||
mkdir -p "${HAULER_DIR}" || fatal "Failed to Create Hauler Directory: ${HAULER_DIR}"
|
||||
if [ ! -d "${HAULER_HOME}" ]; then
|
||||
mkdir -p "${HAULER_HOME}" || fatal "Failed to Create Hauler Directory: ${HAULER_HOME}"
|
||||
fi
|
||||
|
||||
# ensure hauler directory is writable (by user or root privileges)
|
||||
chmod -R 777 "${HAULER_DIR}" || fatal "Failed to Update Permissions of Hauler Directory: ${HAULER_DIR}"
|
||||
chmod -R 777 "${HAULER_HOME}" || fatal "Failed to Update Permissions of Hauler Directory: ${HAULER_HOME}"
|
||||
|
||||
# change to hauler directory
|
||||
cd "${HAULER_DIR}" || fatal "Failed to Change Directory to Hauler Directory: ${HAULER_DIR}"
|
||||
cd "${HAULER_HOME}" || fatal "Failed to Change Directory to Hauler Directory: ${HAULER_HOME}"
|
||||
|
||||
# start hauler artifacts download
|
||||
info "Starting Download..."
|
||||
|
||||
@@ -256,7 +256,7 @@ func getCosignPath() (string, error) {
|
||||
homeDir := currentUser.HomeDir
|
||||
|
||||
// Construct the path to the .hauler directory
|
||||
haulerDir := os.Getenv("HAULER_DIR")
|
||||
haulerDir := os.Getenv("HAULER_HOME")
|
||||
if haulerDir == "" {
|
||||
haulerDir = filepath.Join(homeDir, ".hauler")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user