22
33# prints colored text
44print_style () {
5+
56 if [ " $2 " == " info" ] ; then
67 COLOR=" 96m" ;
78 elif [ " $2 " == " success" ] ; then
@@ -21,7 +22,7 @@ print_style () {
2122}
2223
2324if [[ $# -eq 0 ]] ; then
24- print_style " Invalid argument." ' danger' ; printf " Available commands:\n" ;
25+ print_style " Invalid argument." " danger" ; printf " Available commands:\n" ;
2526 print_style " install" " success" ; printf " \t\t Installs docker-sync gem on the host machine.\n" ;
2627 print_style " up <services>" " success" ; printf " \t Starts docker-sync and runs docker compose.\n" ;
2728 print_style " down" " success" ; printf " \t\t\t Stops containers and docker-sync.\n" ;
3334
3435if [ " $1 " == " up" ] ; then
3536 print_style " Initializing Docker Sync\n" " info" ;
36- print_style " (May take a long time (15min+) on the 'Looking for changes' step the first time)\n" ' warning' ;
37+ print_style " (May take a long time (15min+) on the 'Looking for changes' step the first time)\n" " warning" ;
3738 docker-sync start;
38- print_style " Initializing Docker Compose\n" ' info' ;
39+ print_style " Initializing Docker Compose\n" " info" ;
3940 shift ; # removing first argument
4041 docker-compose -f docker-compose.yml -f docker-compose.sync.yml up -d ${@ } ;
4142
4243elif [ " $1 " == " down" ]; then
43- print_style " Stopping Docker Compose\n" ' info' ;
44+ print_style " Stopping Docker Compose\n" " info" ;
4445 docker-compose down;
45- print_style " Stopping Docker Sync\n" ' info' ;
46+ print_style " Stopping Docker Sync\n" " info" ;
4647 docker-sync stop;
4748
4849elif [ " $1 " == " install" ]; then
49- print_style " Installing docker-sync\n" ' info' ;
50+ print_style " Installing docker-sync\n" " info" ;
5051 gem install docker-sync;
5152
5253elif [ " $1 " == " trigger" ]; then
53- print_style " Manually triggering sync between host and docker-sync container.\n" ' info' ;
54+ print_style " Manually triggering sync between host and docker-sync container.\n" " info" ;
5455 docker-sync sync;
5556
5657elif [ " $1 " == " clean" ]; then
57- print_style " Removing and cleaning up files from the docker-sync container.\n" ' warning' ;
58+ print_style " Removing and cleaning up files from the docker-sync container.\n" " warning" ;
5859 docker-sync clean;
5960
6061else
61- print_style " Invalid argument. Use 'up','down','install','trigger' or 'clean'" ' danger' ;
62+ print_style " Invalid argument. Use 'up','down','install','trigger' or 'clean'" " danger" ;
6263fi
0 commit comments