mirror of
https://github.com/TangentFoxy/love-release.git
synced 2025-07-28 11:02:20 +00:00
Options can be prefixed for a specific module
Options can now be prefixed to be used only for the module the prefix corresponds to. For example `--author` will set the author's name for the whole project, but `--Wauthor` will set it for Windows only and `--Dauthor` for Debian only. If a module requires new options, they will be automatically prefixed at compilation. Most of the modules options have been renamed for consistency. The `read_option` function was added to parse the default options. It can use a prefix to parse the options for a module. Each module now has a specific directory in the cache to allow per-module cache cleaning.
This commit is contained in:
22
Makefile
22
Makefile
@@ -10,12 +10,16 @@ COMPLETION_DIR=/usr/share/bash-completion/completions
|
|||||||
SED_INSTALL_DIR=$(shell echo "$(INSTALL_DIR)" | sed -e 's/[\/&]/\\&/g')
|
SED_INSTALL_DIR=$(shell echo "$(INSTALL_DIR)" | sed -e 's/[\/&]/\\&/g')
|
||||||
|
|
||||||
love-release: clean
|
love-release: clean
|
||||||
mkdir -p $(BUILD_DIR)
|
mkdir -p '$(BUILD_DIR)'
|
||||||
|
longopt=$$(grep "^LONG_OPTIONS" love-release.sh | sed -re 's/LONG_OPTIONS="(.*)"/\1/'); \
|
||||||
for file in scripts/*.sh; do \
|
for file in scripts/*.sh; do \
|
||||||
short="$${short}$$(grep -E -m 1 "^OPTIONS=['\"]?.*['\"]?" "$$file" | sed -r -e "s/OPTIONS=['\"]?//" -e "s/['\"]?$$//")"; \
|
s="$$(grep -E -m 1 "^OPTIONS=['\"]?.*['\"]?" "$$file" | sed -re "s/OPTIONS=['\"]?//" -e "s/['\"]?$$//")"; \
|
||||||
long="$${long}$$(grep -E -m 1 "^LONG_OPTIONS=['\"]?.*['\"]?" "$$file" | sed -r -e "s/LONG_OPTIONS=['\"]?//" -e "s/['\"]?$$//")"; \
|
short="$${s}$${short}"; \
|
||||||
|
l="$$s$$(echo "$$longopt" | sed -e "s/,/,$${s}/g")"; \
|
||||||
|
ll="$$(grep -E -m 1 "^LONG_OPTIONS=['\"]?.*['\"]?" "$$file" | sed -re "s/LONG_OPTIONS=['\"]?//" -e "s/['\"]?$$//" -e "s/,/,$${s}/g")"; \
|
||||||
|
if [[ -n $$ll ]]; then l="$${l},$${s}$${ll}"; fi; \
|
||||||
|
long="$${l},$${long}"; \
|
||||||
done; \
|
done; \
|
||||||
if [[ -n $$long && $${long: -1} != ',' ]]; then long="$${long},"; fi; \
|
|
||||||
sed -re "s/^OPTIONS=(['\"]?)/OPTIONS=\1$$short/" -e "s/^LONG_OPTIONS=(['\"]?)/LONG_OPTIONS=\1$$long/" \
|
sed -re "s/^OPTIONS=(['\"]?)/OPTIONS=\1$$short/" -e "s/^LONG_OPTIONS=(['\"]?)/LONG_OPTIONS=\1$$long/" \
|
||||||
-e 's/INSTALLED=false/INSTALLED=true/' \
|
-e 's/INSTALLED=false/INSTALLED=true/' \
|
||||||
-e 's/SCRIPTS_DIR="scripts"/SCRIPTS_DIR="$(SED_INSTALL_DIR)\/scripts"/' love-release.sh > '$(BUILD_DIR)/love-release'
|
-e 's/SCRIPTS_DIR="scripts"/SCRIPTS_DIR="$(SED_INSTALL_DIR)\/scripts"/' love-release.sh > '$(BUILD_DIR)/love-release'
|
||||||
@@ -32,14 +36,18 @@ install:
|
|||||||
|
|
||||||
embedded: clean
|
embedded: clean
|
||||||
mkdir -p '$(BUILD_DIR)'
|
mkdir -p '$(BUILD_DIR)'
|
||||||
|
longopt=$$(grep "^LONG_OPTIONS" love-release.sh | sed -re 's/LONG_OPTIONS="(.*)"/\1/'); \
|
||||||
for file in scripts/*.sh; do \
|
for file in scripts/*.sh; do \
|
||||||
module="$$(basename -s '.sh' "$$file")"; \
|
module="$$(basename -s '.sh' "$$file")"; \
|
||||||
content='(source <(cat <<\EndOfModule'$$'\n'"$$(cat $$file)"$$'\n''EndOfModule'$$'\n''))'$$'\n''default_module'$$'\n\n'; \
|
content='(source <(cat <<\EndOfModule'$$'\n'"$$(cat $$file)"$$'\n''EndOfModule'$$'\n''))'$$'\n''default_module'$$'\n\n'; \
|
||||||
echo "$$content" >> "$(BUILD_DIR)/tmp"; \
|
echo "$$content" >> "$(BUILD_DIR)/tmp"; \
|
||||||
short="$${short}$$(grep -E -m 1 "^OPTIONS=['\"]?.*['\"]?" "$$file" | sed -r -e "s/OPTIONS=['\"]?//" -e "s/['\"]?$$//")"; \
|
s="$$(grep -E -m 1 "^OPTIONS=['\"]?.*['\"]?" "$$file" | sed -re "s/OPTIONS=['\"]?//" -e "s/['\"]?$$//")"; \
|
||||||
long="$${long}$$(grep -E -m 1 "^LONG_OPTIONS=['\"]?.*['\"]?" "$$file" | sed -r -e "s/LONG_OPTIONS=['\"]?//" -e "s/['\"]?$$//")"; \
|
short="$${s}$${short}"; \
|
||||||
|
l="$$s$$(echo "$$longopt" | sed -e "s/,/,$${s}/g")"; \
|
||||||
|
ll="$$(grep -E -m 1 "^LONG_OPTIONS=['\"]?.*['\"]?" "$$file" | sed -re "s/LONG_OPTIONS=['\"]?//" -e "s/['\"]?$$//" -e "s/,/,$${s}/g")"; \
|
||||||
|
if [[ -n $$ll ]]; then l="$${l},$${s}$${ll}"; fi; \
|
||||||
|
long="$${l},$${long}"; \
|
||||||
done; \
|
done; \
|
||||||
if [[ -n $$long && $${long: -1} != ',' ]]; then long="$${long},"; fi; \
|
|
||||||
sed -re "s/^OPTIONS=(['\"]?)/OPTIONS=\1$$short/" -e "s/^LONG_OPTIONS=(['\"]?)/LONG_OPTIONS=\1$$long/" \
|
sed -re "s/^OPTIONS=(['\"]?)/OPTIONS=\1$$short/" -e "s/^LONG_OPTIONS=(['\"]?)/LONG_OPTIONS=\1$$long/" \
|
||||||
-e 's/EMBEDDED=false/EMBEDDED=true/' \
|
-e 's/EMBEDDED=false/EMBEDDED=true/' \
|
||||||
-e '/include_scripts_here$$/r $(BUILD_DIR)/tmp' love-release.sh > '$(BUILD_DIR)/love-release.sh'
|
-e '/include_scripts_here$$/r $(BUILD_DIR)/tmp' love-release.sh > '$(BUILD_DIR)/love-release.sh'
|
||||||
|
41
README.md
41
README.md
@@ -71,6 +71,9 @@ See the `conf.lua` file included to see how configuration works.
|
|||||||
`-W64` Create Windows x64 executable only
|
`-W64` Create Windows x64 executable only
|
||||||
|
|
||||||
#### PROJECT OPTIONS
|
#### PROJECT OPTIONS
|
||||||
|
You can use the option of a module and append a long option from this list to set a specific
|
||||||
|
option for a module. For example, the option `--Wauthor` will set the author's name for windows only.
|
||||||
|
|
||||||
`-a, --author` Set the project's author.
|
`-a, --author` Set the project's author.
|
||||||
|
|
||||||
`-d, --description` Set the project's description.
|
`-d, --description` Set the project's description.
|
||||||
@@ -101,54 +104,54 @@ containing your game executable and its dlls.
|
|||||||
Creating installers and using icons require [Wine](http://www.winehq.org/) to be installed.
|
Creating installers and using icons require [Wine](http://www.winehq.org/) to be installed.
|
||||||
When the script installs Resource Hacker or Inno Setup, an install wizard GUI will appear.
|
When the script installs Resource Hacker or Inno Setup, an install wizard GUI will appear.
|
||||||
Please let everything as is, do not uncheck checkboxes or replace installation directory.
|
Please let everything as is, do not uncheck checkboxes or replace installation directory.
|
||||||
`--win-icon` Path to an ico file to use.
|
`--Wicon` Path to an ico file to use.
|
||||||
`--win-installer` Create an installer with [Inno Setup](http://www.jrsoftware.org/isinfo.php).
|
`--Winstaller` Create an installer with [Inno Setup](http://www.jrsoftware.org/isinfo.php).
|
||||||
`--win-appid` Your game ID. You can use a GUID/UUID and generate one with `uuidgen`.
|
`--Wappid` Your game ID. You can use a GUID/UUID and generate one with `uuidgen`.
|
||||||
It should remain the same between updates.
|
It should remain the same between updates.
|
||||||
Mandatory if using an installer, not needed for a simple zip.
|
Mandatory if using an installer, not needed for a simple zip.
|
||||||
`--win-maintainer-name` Set the maintainer’s name.
|
`--Wauthor` Set the maintainer’s name.
|
||||||
Mandatory if using an installer, not needed for a simple zip.
|
Mandatory if using an installer, not needed for a simple zip.
|
||||||
`--win-package-name` Set the name of your package.
|
`--Wpkg` Set the name of your package.
|
||||||
Mandatory if using an installer, not needed for a simple zip.
|
Mandatory if using an installer, not needed for a simple zip.
|
||||||
`--win-package-version` Set the version of your package.
|
`--Wversion` Set the version of your package.
|
||||||
Mandatory if using an installer, not needed for a simple zip.
|
Mandatory if using an installer, not needed for a simple zip.
|
||||||
|
|
||||||
#### MAC OS X
|
#### MAC OS X
|
||||||
`--osx-icon` Path to an icns file to use.
|
`--Micon` Path to an icns file to use.
|
||||||
`--osx-maintainer-name` Set the maintainer’s name. Provide it for OS X CFBundleIdentifier.
|
`--Mauthor` Set the maintainer’s name. Provide it for OS X CFBundleIdentifier.
|
||||||
|
|
||||||
#### DEBIAN
|
#### DEBIAN
|
||||||
`--deb-icon` Path to a single folder where icons are stored.
|
`--Dicon` Path to a single folder where icons are stored.
|
||||||
To be properly recognized, icons filename must contain `YYxYY`,
|
To be properly recognized, icons filename must contain `YYxYY`,
|
||||||
where `YY` is the resolution of the icon.
|
where `YY` is the resolution of the icon.
|
||||||
SVG files are recognized if suffixed with `.svg`.
|
SVG files are recognized if suffixed with `.svg`.
|
||||||
Other files will be ignored.
|
Other files will be ignored.
|
||||||
`--maintainer-email` Set the maintainer’s email.
|
`--Demail` Set the maintainer’s email.
|
||||||
`--deb-maintainer-name` Set the maintainer’s name.
|
`--Dauthor` Set the maintainer’s name.
|
||||||
`--deb-package-name` Set the name of the package and the command that will be used to launch your game.
|
`--Dpkg` Set the name of the package and the command that will be used to launch your game.
|
||||||
By default, it is the name of your project converted to lowercase,
|
By default, it is the name of your project converted to lowercase,
|
||||||
with eventual spaces replaced by dashes.
|
with eventual spaces replaced by dashes.
|
||||||
`--deb-package-version` Set the version of your package.
|
`--Dversion` Set the version of your package.
|
||||||
|
|
||||||
#### ANDROID
|
#### ANDROID
|
||||||
Note that every argument passed to the options should be alphanumerical,
|
Note that every argument passed to the options should be alphanumerical,
|
||||||
with eventual underscores (i.e. [a-zA-Z0-9\_]), otherwise you'll get errors.
|
with eventual underscores (i.e. [a-zA-Z0-9\_]), otherwise you'll get errors.
|
||||||
`--apk-icon` Path to a single folder where icons are stored.
|
`--Aicon` Path to a single folder where icons are stored.
|
||||||
The script will first look up for filename that contains
|
The script will first look up for filename that contains
|
||||||
`42x42`, `72x72`, `96x96` or `144x144`.
|
`42x42`, `72x72`, `96x96` or `144x144`.
|
||||||
It will then search the icon directory for subdirectories like
|
It will then search the icon directory for subdirectories like
|
||||||
`drawable-mdpi`, `drawable-hdpi`, `drawable-xhdpi` and `drawable-xxhdpi`
|
`drawable-mdpi`, `drawable-hdpi`, `drawable-xhdpi` and `drawable-xxhdpi`
|
||||||
to find an `ic_launcher.png` image.
|
to find an `ic_launcher.png` image.
|
||||||
OUYA icon (size `732x412`, or `drawable-xhdpi/ouya_icon.png`) is supported.
|
OUYA icon (size `732x412`, or `drawable-xhdpi/ouya_icon.png`) is supported.
|
||||||
`--apk-activity` The name of the class that extends GameActivity.
|
`--Aactivity` The name of the class that extends GameActivity.
|
||||||
By default it is the name of the project with ‘Activity’ appended,
|
By default it is the name of the project with ‘Activity’ appended,
|
||||||
eventual spaces and dashes replaced by underscores.
|
eventual spaces and dashes replaced by underscores.
|
||||||
`--apk-maintainer-name` Set the maintainer’s name.
|
`--Aauthor` Set the maintainer’s name.
|
||||||
It must be only alphanumerical characters, with eventual underscores.
|
It must be only alphanumerical characters, with eventual underscores.
|
||||||
`--apk-package-name` Set the name of the package.
|
`--Apkg` Set the name of the package.
|
||||||
By default, it is the name of your project, with eventual spaces replaced by underscores.
|
By default, it is the name of your project, with eventual spaces replaced by underscores.
|
||||||
`--apk-package-version` Set the version of your package.
|
`--Aversion` Set the version of your package.
|
||||||
`--update-android` Update the love-android-sdl2.git repository used in the cache.
|
`--Aupdate` Update the love-android-sdl2.git repository used in the cache.
|
||||||
|
|
||||||
#### OTHERS
|
#### OTHERS
|
||||||
`--clean` Clean the cache located in `~/.cache/love-release`.
|
`--clean` Clean the cache located in `~/.cache/love-release`.
|
||||||
|
@@ -63,6 +63,9 @@ Create Windows x86 executable only.
|
|||||||
.B \-W64
|
.B \-W64
|
||||||
Create Windows x64 executable only.
|
Create Windows x64 executable only.
|
||||||
.SH PROJECT OPTIONS
|
.SH PROJECT OPTIONS
|
||||||
|
You can use the option of a module and append a long option from this list to set a specific
|
||||||
|
option for a module. For example, the option \fI\-\-Wauthor\fR will set the author's name for windows only.
|
||||||
|
.br
|
||||||
.TP
|
.TP
|
||||||
.B \-a, \-\-author \fIauthor\fR
|
.B \-a, \-\-author \fIauthor\fR
|
||||||
Set the project's author.
|
Set the project's author.
|
||||||
@@ -105,62 +108,62 @@ Creating installers and using icons require Wine to be installed.
|
|||||||
When the script installs Resource Hacker or Inno Setup, an install wizard GUI will appear.
|
When the script installs Resource Hacker or Inno Setup, an install wizard GUI will appear.
|
||||||
Please let everything as is, do not uncheck checkboxes or replace installation directory.
|
Please let everything as is, do not uncheck checkboxes or replace installation directory.
|
||||||
.TP
|
.TP
|
||||||
.B \-\-win\-icon \fIicon\fR
|
.B \-\-Wicon \fIicon\fR
|
||||||
Path to an ico file to use.
|
Path to an ico file to use.
|
||||||
.TP
|
.TP
|
||||||
.B \-\-win\-installer
|
.B \-\-Winstaller
|
||||||
Create an installer with Inno Setup.
|
Create an installer with Inno Setup.
|
||||||
.TP
|
.TP
|
||||||
.B \-\-win\-appid \fIid\fR
|
.B \-\-Wappid \fIid\fR
|
||||||
Your game ID. You can use a GUID/UUID and generate one with \fIuuigen\fR.
|
Your game ID. You can use a GUID/UUID and generate one with \fIuuigen\fR.
|
||||||
It should remain the same between updates.
|
It should remain the same between updates.
|
||||||
Mandatory if using an installer, not needed for a simple zip.
|
Mandatory if using an installer, not needed for a simple zip.
|
||||||
.TP
|
.TP
|
||||||
.B \-\-win\-maintainer\-name \fIname\fR
|
.B \-\-Wauthor \fIname\fR
|
||||||
Set the maintainer’s name.
|
Set the maintainer’s name.
|
||||||
Mandatory if using an installer, not needed for a simple zip.
|
Mandatory if using an installer, not needed for a simple zip.
|
||||||
.TP
|
.TP
|
||||||
.B \-\-win\-package\-name \fIname\fR
|
.B \-\-Wpkg \fIname\fR
|
||||||
Set the name of the package.
|
Set the name of the package.
|
||||||
Mandatory if using an installer, not needed for a simple zip.
|
Mandatory if using an installer, not needed for a simple zip.
|
||||||
.TP
|
.TP
|
||||||
.B \-\-win\-package\-version \fIversion\fR
|
.B \-\-Wversion \fIversion\fR
|
||||||
Set the version of your package.
|
Set the version of your package.
|
||||||
Mandatory if using an installer, not needed for a simple zip.
|
Mandatory if using an installer, not needed for a simple zip.
|
||||||
.SH MAC OS X
|
.SH MAC OS X
|
||||||
.TP
|
.TP
|
||||||
.B \-\-osx\-icon \fIicon\fR
|
.B \-\-Micon \fIicon\fR
|
||||||
Path to an icns file to use.
|
Path to an icns file to use.
|
||||||
.TP
|
.TP
|
||||||
.B \-\-osx\-maintainer\-name \fIname\fR
|
.B \-\-Mauthor \fIname\fR
|
||||||
Set the maintainer's name. Provide it for OS X CFBundleIdentifier.
|
Set the maintainer's name. Provide it for OS X CFBundleIdentifier.
|
||||||
.SH DEBIAN
|
.SH DEBIAN
|
||||||
.TP
|
.TP
|
||||||
.B \-\-deb-icon \fIdir\fR
|
.B \-\-Dicon \fIdir\fR
|
||||||
Path to a single folder where icons are stored.
|
Path to a single folder where icons are stored.
|
||||||
To be properly recognized, icons filename must contain \fIYYxYY\fR,
|
To be properly recognized, icons filename must contain \fIYYxYY\fR,
|
||||||
where \fIYY\fR is the resolution of the icon.
|
where \fIYY\fR is the resolution of the icon.
|
||||||
SVG files are recognized if suffixed with \fI.svg\fR.
|
SVG files are recognized if suffixed with \fI.svg\fR.
|
||||||
Other files will be ignored.
|
Other files will be ignored.
|
||||||
.TP
|
.TP
|
||||||
.B \-\-maintainer-email \fIemail\fR
|
.B \-\-Demail \fIemail\fR
|
||||||
Set the maintainer's email.
|
Set the maintainer's email.
|
||||||
.TP
|
.TP
|
||||||
.B \-\-deb\-maintainer\-name \fIname\fR
|
.B \-\-Dauthor \fIname\fR
|
||||||
Set the maintainer's name.
|
Set the maintainer's name.
|
||||||
.TP
|
.TP
|
||||||
.B \-\-deb\-package-name \fIname\fR
|
.B \-\-Dpkg \fIname\fR
|
||||||
Set the name of the package and the command that will be use to launch your game.
|
Set the name of the package and the command that will be use to launch your game.
|
||||||
By default, it is the name of your project converted to lowercase,
|
By default, it is the name of your project converted to lowercase,
|
||||||
with eventual spaces replaced by dashes.
|
with eventual spaces replaced by dashes.
|
||||||
.TP
|
.TP
|
||||||
.B \-\-deb\-package\-version \fIversion\fR
|
.B \-\-Dversion \fIversion\fR
|
||||||
Set the version of your package.
|
Set the version of your package.
|
||||||
.SH ANDROID
|
.SH ANDROID
|
||||||
Note that every argument passed to the options should be alphanumerical,
|
Note that every argument passed to the options should be alphanumerical,
|
||||||
with eventual underscores (i.e. [a-zA-Z0-9_]), otherwise you'll get errors.
|
with eventual underscores (i.e. [a-zA-Z0-9_]), otherwise you'll get errors.
|
||||||
.TP
|
.TP
|
||||||
.B \-\-apk\-icon \fIdir\fR
|
.B \-\-Aicon \fIdir\fR
|
||||||
Path to a single folder where icons are stored.
|
Path to a single folder where icons are stored.
|
||||||
The script will first look up for filename that contains
|
The script will first look up for filename that contains
|
||||||
\fI42x42\fR, \fI72x72\fR, \fI96x96\fR or \fI144x144\fR.
|
\fI42x42\fR, \fI72x72\fR, \fI96x96\fR or \fI144x144\fR.
|
||||||
@@ -169,23 +172,23 @@ It will then search the icon directory for subdirectories like
|
|||||||
to find an \fIic_launcher.png\fR image.
|
to find an \fIic_launcher.png\fR image.
|
||||||
OUYA icon (size \fI732x412\fR, or \fIdrawable-xhdpi/ouya_icon.png\fR) is supported.
|
OUYA icon (size \fI732x412\fR, or \fIdrawable-xhdpi/ouya_icon.png\fR) is supported.
|
||||||
.TP
|
.TP
|
||||||
.B \-\-apk\-activity \fIactivity\fR
|
.B \-\-Aactivity \fIactivity\fR
|
||||||
The name of the class that extends GameActivity.
|
The name of the class that extends GameActivity.
|
||||||
By default it is the name of the project with 'Activity' appended,
|
By default it is the name of the project with 'Activity' appended,
|
||||||
eventual spaces and dashes replaced by underscores.
|
eventual spaces and dashes replaced by underscores.
|
||||||
.TP
|
.TP
|
||||||
.B \-\-apk\-maintainer\-name \fIname\fR
|
.B \-\-Aauthor \fIname\fR
|
||||||
Set the maintainer’s name.
|
Set the maintainer’s name.
|
||||||
It must be only alphanumerical characters, with eventual underscores.
|
It must be only alphanumerical characters, with eventual underscores.
|
||||||
.TP
|
.TP
|
||||||
.B \-\-apk\-package\-name \fIname\fR
|
.B \-\-Apkg \fIname\fR
|
||||||
Set the name of the package.
|
Set the name of the package.
|
||||||
By default, it is the name of your project, with eventual spaces replaced by underscores.
|
By default, it is the name of your project, with eventual spaces replaced by underscores.
|
||||||
.TP
|
.TP
|
||||||
.B \-\-apk\-package\-version \fIversion\fR
|
.B \-\-Aversion \fIversion\fR
|
||||||
Set the version of your package.
|
Set the version of your package.
|
||||||
.TP
|
.TP
|
||||||
.B \-\-update\-android
|
.B \-\-Aupdate
|
||||||
Update the love-android-sdl2.git repository used in the cache.
|
Update the love-android-sdl2.git repository used in the cache.
|
||||||
.SH OTHERS
|
.SH OTHERS
|
||||||
.TP
|
.TP
|
||||||
|
@@ -230,6 +230,33 @@ EOF
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Read script options
|
||||||
|
## $1: options prefix
|
||||||
|
read_options () {
|
||||||
|
local pre="$1"
|
||||||
|
eval set -- "$ARGS"
|
||||||
|
while true; do
|
||||||
|
case "$1" in
|
||||||
|
-a|--${pre}author ) AUTHOR="$2"; shift 2 ;;
|
||||||
|
--clean ) rm -rf "$CACHE_DIR"; shift ;;
|
||||||
|
-d|--${pre}description ) DESCRIPTION="$2"; shift 2 ;;
|
||||||
|
-e|--${pre}email ) EMAIL="$2"; shift 2 ;;
|
||||||
|
-h|--${pre}help ) short_help; exit 0 ;;
|
||||||
|
-i|--${pre}icon ) ICON="$2"; shift 2 ;;
|
||||||
|
-l|--${pre}love ) if ! gen_version "$2"; then exit_module "version"; fi; shift 2 ;;
|
||||||
|
-p|--${pre}pkg ) IDENTITY="$2"; shift 2 ;;
|
||||||
|
-r|--${pre}release ) RELEASE_DIR="$2"; shift 2 ;;
|
||||||
|
-t|--${pre}title ) TITLE="$2"; shift 2 ;;
|
||||||
|
-u|--${pre}url ) URL="$2"; shift 2 ;;
|
||||||
|
-v|--${pre}version ) GAME_VERSION="$2"; shift 2 ;;
|
||||||
|
-- ) shift; break ;;
|
||||||
|
* ) shift ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# Test if default module should be executed
|
# Test if default module should be executed
|
||||||
default_module () {
|
default_module () {
|
||||||
if [[ $? -ne 2 ]]; then
|
if [[ $? -ne 2 ]]; then
|
||||||
@@ -301,10 +328,12 @@ init_module () {
|
|||||||
fi
|
fi
|
||||||
if compare_version "$LOVE_VERSION" ">" "$VERSION"; then
|
if compare_version "$LOVE_VERSION" ">" "$VERSION"; then
|
||||||
echo "LÖVE $LOVE_VERSION is out ! Your project uses LÖVE ${VERSION}."
|
echo "LÖVE $LOVE_VERSION is out ! Your project uses LÖVE ${VERSION}."
|
||||||
|
fi
|
||||||
gen_version $VERSION
|
gen_version $VERSION
|
||||||
unset VERSION
|
unset VERSION
|
||||||
fi
|
|
||||||
MODULE="$1"
|
MODULE="$1"
|
||||||
|
CACHE_DIR="$CACHE_DIR/$2"
|
||||||
|
read_options "$3"
|
||||||
mkdir -p "$RELEASE_DIR" "$CACHE_DIR"
|
mkdir -p "$RELEASE_DIR" "$CACHE_DIR"
|
||||||
echo "Generating $TITLE with LÖVE $LOVE_VERSION for ${MODULE}..."
|
echo "Generating $TITLE with LÖVE $LOVE_VERSION for ${MODULE}..."
|
||||||
return 0
|
return 0
|
||||||
@@ -373,30 +402,13 @@ LONG_OPTIONS="author:,clean,description:,email:,help,icon:,love:,pkg:,release:,t
|
|||||||
ARGS=$(getopt -o "$OPTIONS" -l "$LONG_OPTIONS" -n 'love-release' -- "$@")
|
ARGS=$(getopt -o "$OPTIONS" -l "$LONG_OPTIONS" -n 'love-release' -- "$@")
|
||||||
if (( $? != 0 )); then short_help; exit_module "options"; fi
|
if (( $? != 0 )); then short_help; exit_module "options"; fi
|
||||||
eval set -- "$ARGS"
|
eval set -- "$ARGS"
|
||||||
|
read_options
|
||||||
while true; do
|
while [[ $1 != '--' ]]; do shift; done; shift
|
||||||
case "$1" in
|
|
||||||
-a|--author ) AUTHOR="$2"; shift 2 ;;
|
|
||||||
--clean ) rm -rf "$CACHE_DIR"; shift ;;
|
|
||||||
-d|--description ) DESCRIPTION="$2"; shift 2 ;;
|
|
||||||
-e|--email ) EMAIL="$2"; shift 2 ;;
|
|
||||||
-h|--help ) short_help; exit 0 ;;
|
|
||||||
-i|--icon ) ICON="$2"; shift 2 ;;
|
|
||||||
-l|--love ) if ! gen_version "$2"; then exit_module "version"; fi; shift 2 ;;
|
|
||||||
-p|--pkg ) IDENTITY="$2"; shift 2 ;;
|
|
||||||
-r|--release ) RELEASE_DIR="$2"; shift 2 ;;
|
|
||||||
-t|--title ) TITLE="$2"; shift 2 ;;
|
|
||||||
-u|--url ) URL="$2"; shift 2 ;;
|
|
||||||
-v|--version ) GAME_VERSION="$2"; shift 2 ;;
|
|
||||||
-- ) shift; break ;;
|
|
||||||
* ) shift ;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
for arg do
|
for arg do
|
||||||
FILES+=( "$arg" )
|
FILES+=( "$arg" )
|
||||||
done
|
done
|
||||||
if (( ${#FILES} == 0 )); then FILES+=( "." ); fi
|
if (( ${#FILES} == 0 )); then FILES+=( "." ); fi
|
||||||
|
eval set -- "$ARGS"
|
||||||
|
|
||||||
if [[ $INSTALLED == false && $EMBEDDED == false ]]; then
|
if [[ $INSTALLED == false && $EMBEDDED == false ]]; then
|
||||||
exit_module "undef" "love-release has not been installed, and is not embedded into one script."
|
exit_module "undef" "love-release has not been installed, and is not embedded into one script."
|
||||||
|
Reference in New Issue
Block a user