Skip to content

Commit

Permalink
Add possibility to ignore modman file with -f option
Browse files Browse the repository at this point in the history
  • Loading branch information
jreinke authored Sep 19, 2019
1 parent e8289ea commit 46bc0cf
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions modgit
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

VERSION="1.0.1"
VERSION="1.1.0"
GITHUB="https://github.com/jreinke/modgit"
AUTHOR="Johann Reinke"
SCRIPT=${0##*/}
Expand Down Expand Up @@ -34,6 +34,7 @@ $(tput bold)Module Commands:$(tput sgr0)
Available options:
-n Dry run mode (show what would be done)
-f Force all files and folders to be deployed (ignore modman mapping file)
-i Include filters (only for add command)
Example: $SCRIPT add $(tput bold)-i lib/ -i foo/:bar/$(tput sgr0) my_module https://github.com/account/repository.git
=> will deploy only lib/ (to lib/) and foo/ (to bar/)
Expand All @@ -52,6 +53,7 @@ Available options:
shopt -s nocasematch

DRY_RUN=0
IGNORE_MODMAN=0
ACTION=""
INCLUDES=""
EXCLUDES="\
Expand Down Expand Up @@ -123,7 +125,7 @@ if [[ "$1" =~ $REGEX_ACTION ]]; then
fi

# Handle options
while getopts ":nvhi:e:b:t:" opt; do
while getopts ":nvhfi:e:b:t:" opt; do
case $opt in
h)
show_help
Expand All @@ -138,6 +140,10 @@ while getopts ":nvhi:e:b:t:" opt; do
DRY_RUN=1
shift $((OPTIND-1)); OPTIND=1
;;
f)
IGNORE_MODMAN=1
shift $((OPTIND-1)); OPTIND=1
;;
i)
add_include "$OPTARG"
shift $((OPTIND-1)); OPTIND=1
Expand Down Expand Up @@ -327,7 +333,7 @@ move_files()

if [ $copy -eq 1 ]; then
# Handle modman file
if [ -s "$modman_file" ]; then
if [ $IGNORE_MODMAN -eq 0 ] && [ -s "$modman_file" ]; then
IFS=$'\n'
for line in $(cat "$modman_file"); do
if [ -z "$line" ] || [[ $line =~ ^# ]] || [[ $line =~ ^@ ]]; then
Expand Down

0 comments on commit 46bc0cf

Please sign in to comment.