use stackrc.example, and prompt user before copying
This commit is contained in:
parent
01ad91a32f
commit
d8c259af5a
4 changed files with 21 additions and 0 deletions
|
@ -1,5 +1,12 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Use stackrc.example if stackrc is missing
|
||||
if [ ! -e ./stackrc ]; then
|
||||
read -n1 -p "No stackrc present. Copy stackrc.example to stackrc? (y/n) "
|
||||
echo
|
||||
[[ $REPLY = [yY] ]] && cp stackrc.example stackrc|| { echo "Aborting: Missing stackrc"; exit 1; }
|
||||
fi
|
||||
|
||||
# Source params
|
||||
source ./stackrc
|
||||
|
||||
|
|
|
@ -1,5 +1,12 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Use stackrc.example if stackrc is missing
|
||||
if [ ! -e ./stackrc ]; then
|
||||
read -n1 -p "No stackrc present. Copy stackrc.example to stackrc? (y/n) "
|
||||
echo
|
||||
[[ $REPLY = [yY] ]] && cp stackrc.example stackrc|| { echo "Aborting: Missing stackrc"; exit 1; }
|
||||
fi
|
||||
|
||||
# Source params
|
||||
source ./stackrc
|
||||
|
||||
|
|
7
stack.sh
7
stack.sh
|
@ -59,6 +59,13 @@ set -o errexit
|
|||
# an error. It is also useful for following allowing as the install occurs.
|
||||
set -o xtrace
|
||||
|
||||
# Use stackrc.example if stackrc is missing
|
||||
if [ ! -e ./stackrc ]; then
|
||||
read -n1 -p "No stackrc present. Copy stackrc.example to stackrc? (y/n) "
|
||||
echo
|
||||
[[ $REPLY = [yY] ]] && cp stackrc.example stackrc|| { echo "Aborting: Missing stackrc"; exit 1; }
|
||||
fi
|
||||
|
||||
# Import variables
|
||||
source ./stackrc
|
||||
|
||||
|
|
Loading…
Reference in a new issue