aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2021-03-29 21:32:42 +0100
committerSimon Tatham <anakin@pobox.com>2021-03-29 21:32:42 +0100
commit71c66b6fbd965a891bdf6546e4d0571da018db8b (patch)
treef04b3ea6487a6fcee5ac31c4896812e08bcbdd17
parent0f3c2f7cd4c59e1eee6c44d800e266b57e2ec33f (diff)
downloadpuzzles-71c66b6fbd965a891bdf6546e4d0571da018db8b.zip
puzzles-71c66b6fbd965a891bdf6546e4d0571da018db8b.tar.gz
puzzles-71c66b6fbd965a891bdf6546e4d0571da018db8b.tar.bz2
puzzles-71c66b6fbd965a891bdf6546e4d0571da018db8b.tar.xz
desktop.pl: cope with unfinished puzzles.
If I built with an unfinished puzzle enabled, then it will end up in the 'unfinished' subdir of the main build directory, so desktop.pl will need to write out a reference to it there.
-rwxr-xr-xdesktop.pl6
1 files changed, 5 insertions, 1 deletions
diff --git a/desktop.pl b/desktop.pl
index 204c0ce..042bf90 100755
--- a/desktop.pl
+++ b/desktop.pl
@@ -36,12 +36,16 @@ while (<$desc>) {
open my $desktop, ">", "$outdir/$id.desktop"
or die "$outdir/$id.desktop: open: $!\n";
+ my $path = "$bindir/$id";
+ my $upath = "$bindir/unfinished/$id";
+ $path = $upath if ! -f $path && -f $upath;
+
print $desktop "[Desktop Entry]\n";
print $desktop "Version=1.0\n";
print $desktop "Type=Application\n";
print $desktop "Name=$displayname\n";
print $desktop "Comment=$description\n";
- print $desktop "Exec=$bindir/$id\n";
+ print $desktop "Exec=$path\n";
print $desktop "Icon=$icondir/$id-48d24.png\n";
print $desktop "StartupNotify=false\n";
print $desktop "Categories=Game;\n";