Changeset - 31c7578fa1b1
[Not reviewed]
0 1 0
Branko Majic (branko) - 2 years ago 2022-08-29 18:13:57
branko@majic.rs
[factorio_development.sh] Make mod directory path optional for init command:

- Default to using the working directory as root.
- Bump the version, initial feature-complete release.
1 file changed with 7 insertions and 6 deletions:
0 comments (0 inline, 0 general) First comment
games/factorio_development.sh
Show inline comments
 
@@ -22,7 +22,7 @@
 
set -u
 

	
 
PROGRAM="factorio_development.sh"
 
VERSION="0.0.5"
 
VERSION="1.0.0"
 

	
 
function usage() {
 
    cat <<EOF
 
@@ -30,7 +30,7 @@ $PROGRAM $VERSION, helper tool for development of Factorio mods
 

	
 
Usage:
 

	
 
  $PROGRAM [OPTIONS] init MOD_DIRECTORY_PATH
 
  $PROGRAM [OPTIONS] init [MOD_DIRECTORY_PATH]
 
  $PROGRAM [OPTIONS] build [MOD_DIRECTORY_PATH]
 
  $PROGRAM [OPTIONS] release [MOD_DIRECTORY_PATH]
 
  $PROGRAM [OPTIONS] abort-release [MOD_DIRECTORY_PATH]
 
@@ -79,7 +79,8 @@ init MOD_DIRECTORY_PATH
 
  Initialises directory for new mod development. Passed-in directory
 
  must be empty. Mod name is derived from the directory name. If the
 
  passed-in mod directory path does not point to an existing
 
  directory, it will be created.
 
  directory, it will be created. If not specified, default is to use
 
  working directory as mod directory path.
 

	
 
  During initialisation it is possible to select if mod sources should
 
  be kept in a separate directory or within the base directory. This
 
@@ -1058,13 +1059,13 @@ shift
 

	
 
if [[ $COMMAND == init ]]; then
 

	
 
    MOD_DIRECTORY_PATH="${1-}"
 
    MOD_DIRECTORY_PATH="${1:-.}"
 
    shift
 

	
 
    DEVELOPMENT_SCRIPT_PATH=$(readlink -f "$0")
 

	
 
    if [[ -z $MOD_DIRECTORY_PATH ]]; then
 
        error "Mod directory path must be specified."
 
    if [[ -e $MOD_DIRECTORY_PATH && ! -d $MOD_DIRECTORY_PATH ]]; then
 
        error "Passed-in path must be a directory."
 
        exit "$ERROR_ARGUMENTS"
 
    fi
 

	
0 comments (0 inline, 0 general) First comment
You need to be logged in to comment. Login now