From 56e048ecb3311c6ebf9100eabcd0c6d97ba64241 Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Thu, 4 Nov 2021 04:37:45 -0500 Subject: [PATCH] Improving defaults and user feedback messages. --- repository/TiddlyWiki/TiddlyWiki.class.st | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/repository/TiddlyWiki/TiddlyWiki.class.st b/repository/TiddlyWiki/TiddlyWiki.class.st index 8946545..c5f14b8 100644 --- a/repository/TiddlyWiki/TiddlyWiki.class.st +++ b/repository/TiddlyWiki/TiddlyWiki.class.st @@ -60,7 +60,11 @@ TiddlyWiki >> exportJSONSubtiddlers: subtiddlersCollection [ { #category : #accessing } TiddlyWiki >> exportSTONFile [ | stonFile output wikiTemp | - stonFile := self tiddlersJSONFile withoutExtension, 'ston'. + self tiddlersJSONFile + ifNil: [ + self inform: 'No JSON Tiddlers file found. If you have one, please provide its location'. + stonFile := FileLocator temp / 'tiddlers.ston' ] + ifNotNil: [ stonFile := self tiddlersJSONFile withoutExtension, 'ston' ]. output := '' writeStream. (STON writer on: output ) newLine: String lf; @@ -199,8 +203,8 @@ TiddlyWiki >> tiddlers: anOrderedCollection [ { #category : #accessing } TiddlyWiki >> tiddlersJSONFile [ | jsonFile | - file ifNil: [ - self inform: 'Provide the location of the TiddlyWiki HTML file.'. + self file ifNil: [ + self inform: 'No TiddlyWiki HTML file found. If you have one, please provide its location.'. ^ nil ]. jsonFile := file parent / 'tiddlers.json'.