Applies some best practices to bash scripts

This commit is contained in:
Jorge Enrique Gómez Gómez 2022-10-13 18:24:38 -05:00
parent 052fc8e94d
commit e548819388
3 changed files with 7 additions and 3 deletions

View File

@ -1,7 +1,8 @@
#!/bin/bash
#!/usr/bin/env bash
#
# Installs selected content from the downloaded repos into a production folder
#
# Warning: git apply may fail if /opt/odoo/.git/ exists
if [ $UID != 0 ]; then
echo "You need administration privileges to run this script."
@ -119,6 +120,7 @@ pt_all ()
pt_community # Apply patches to OCA modules
}
set -ueo pipefail
if (($# == 0))
then
Help

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# Installs selected content from the downloaded repos into a production folder
#
@ -137,6 +137,7 @@ cp_all ()
cp_custom # Install Custom modules
}
set -ueo pipefail
if (($# == 0))
then
Help

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# Updates code from the git repositories selected
#
@ -150,6 +150,7 @@ gt_all ()
gt_custom # Custom in-house modules
}
set -ueo pipefail
if (($# == 0))
then
Help