Răsfoiți Sursa

support nuke to nothing

George S. Baugh 4 ani în urmă
părinte
comite
d48bee4694
2 a modificat fișierele cu 17 adăugiri și 5 ștergeri
  1. 16 4
      Makefile
  2. 1 1
      lib/Trog/SQLite/TagIndex.pm

+ 16 - 4
Makefile

@@ -2,10 +2,9 @@
 # Or, having the app bootstrap it.
 .PHONY: install
 install:
-	test -d $(HOME)/.tcms || mkdir $(HOME)/.tcms
-	test -d www/themes || mkdir www/themes
-	test -d data/files || mkdir data/files
-	test -d www/assets || mkdir www/assets
+	test -d www/themes || mkdir -p www/themes
+	test -d data/files || mkdir -p data/files
+	test -d www/assets || mkdir -p www/assets
 	$(RM) pod2htmd.tmp;
 
 .PHONY: install-service
@@ -39,3 +38,16 @@ prereq-frontend:
 	mkdir -p www/scripts; cd www/scripts && curl -L --remote-name-all                                 \
 		"https://github.com/woody180/vanilla-javascript-emoji-picker/raw/master/fgEmojiPicker.js"     \
 	  "https://github.com/woody180/vanilla-javascript-emoji-picker/raw/master/full-emoji-list.json"
+
+.PHONY: reset
+reset: reset-remove install
+
+.PHONY: reset-remove
+reset-remove:
+	rm -rf data
+	rm -rf www/themes
+	rm -rf www/assets
+	rm config/auth.db
+	rm config/main.cfg
+	rm config/has_users
+	rm config/setup

+ 1 - 1
lib/Trog/SQLite/TagIndex.pm

@@ -96,7 +96,7 @@ sub build_routes($data_obj,$posts=[]) {
     # Now, compile the post aliases
     my %routes_actual = routes();
     foreach my $post (@$posts) {
-        next unless @{$post->{aliases}};
+        next unless (ref $post->{aliases} eq 'ARRAY') && @{$post->{aliases}};
         my $route = $post->{local_href};
         Trog::SQLite::bulk_insert($dbh, 'post_aliases', [qw{route_id alias}], 'IGNORE', map { ($routes_actual{$route}{id}, $_) } @{$post->{aliases}} );
     }