Skip to content

Commit b8fb713

Browse files
committed
Fix up config environments (XDG layout). Enh. #4)
1 parent 16a16eb commit b8fb713

16 files changed

Lines changed: 446 additions & 40 deletions

docs/CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@ Doomy (C) Matt Tropiano
33
by Matt Tropiano et al. (see AUTHORS.txt)
44

55

6+
0.11.0
7+
------
8+
9+
- `Changed` Doomy now uses different directories for storing config and its data, and uses XDG config layouts on Linux, if available. (Enh. #4)
10+
11+
In order to MIGRATE your data to this version from a previous one, you'll have to go to your settings directory,
12+
and move your `presets` folder and `doomy.db` file into a folder in the same directory called `data`.
13+
14+
If you have an XDG environment on Linux, you'll figure it out.
15+
16+
617
0.10.0
718
------
819

shell/jar/app-name.cmd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ SET MAINCLASS={{MAIN_CLASSNAME}}
1010
REM ===== Get latest JAR.
1111
FOR /F %%F in ('dir "%~dp0\jar\*.jar" /a/b/n') DO (SET JAVAJAR=jar\%%F)
1212

13+
SET DOOMY_PATH=%~dp0
14+
SET DOOMY_JAR=%JAVAJAR%
15+
1316
REM =========================================================================
1417

1518
REM ===== Java Scan

shell/jar/app-name.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
1212
fi
1313
SCRIPTDIR="$(cd "$(dirname $($CMD_READLINK "$0"))"; pwd)"
1414

15+
DOOMY_PATH=${SCRIPTDIR}
16+
1517
DOOMY_JAR="jar/$((cd ${SCRIPTDIR}/jar && ls -1a *.jar) | sort | tail -1)"
1618
JAVAJAR="${SCRIPTDIR}/${DOOMY_JAR}"
1719
if [[ "$OSTYPE" == "cygwin"* ]]; then

src/main/java/net/mtrop/doomy/DoomyCommand.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import net.mtrop.doomy.commands.ConfigCommand;
1111
import net.mtrop.doomy.commands.DefaultCommand;
1212
import net.mtrop.doomy.commands.EngineCommand;
13+
import net.mtrop.doomy.commands.EnvironmentCommand;
1314
import net.mtrop.doomy.commands.HelpCommand;
1415
import net.mtrop.doomy.commands.IWADCommand;
1516
import net.mtrop.doomy.commands.IdGamesCommand;
@@ -97,6 +98,7 @@ public interface DoomyCommand
9798
static final String VERSION = "version";
9899
static final String HELP = "help";
99100
static final String CONFIG = "config";
101+
static final String ENV = "env";
100102
static final String ENGINE = "engine";
101103
static final String TEMPLATE = "template";
102104
static final String IWAD = "iwad";
@@ -200,6 +202,8 @@ else if (matchArgument(args, VERSION))
200202
return new VersionCommand();
201203
else if (matchArgument(args, HELP))
202204
return new HelpCommand();
205+
else if (matchArgument(args, ENV))
206+
return new EnvironmentCommand();
203207
else if (matchArgument(args, CONFIG))
204208
{
205209
if (matchArgument(args, LIST))

src/main/java/net/mtrop/doomy/DoomyCommon.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,11 @@ public static void help(IOHandler handler, String commandName)
276276
wrapPrint(handler, 80, 40, " help Print all of this help.");
277277
handler.outln();
278278
}
279+
if (commandName == null || DoomyCommand.ENV.equalsIgnoreCase(commandName))
280+
{
281+
wrapPrint(handler, 80, 40, " env Print environment paths that Doomy uses.");
282+
handler.outln();
283+
}
279284
if (commandName == null || DoomyCommand.CONFIG.equalsIgnoreCase(commandName))
280285
{
281286
wrapPrint(handler, 80, 40, " config Print this subsection's help and terminate.");

0 commit comments

Comments
 (0)