From 23619899c597baa75be68a61c6f9a00df79cfcaf Mon Sep 17 00:00:00 2001 From: ruidajo Date: Mon, 7 Mar 2022 13:29:30 -0500 Subject: [PATCH] Modifying the exporting JSON optimized. --- repository/TiddlyWiki/TiddlyWiki.class.st | 37 +++++++++++++++-------- 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/repository/TiddlyWiki/TiddlyWiki.class.st b/repository/TiddlyWiki/TiddlyWiki.class.st index 711a586..4dc2d20 100644 --- a/repository/TiddlyWiki/TiddlyWiki.class.st +++ b/repository/TiddlyWiki/TiddlyWiki.class.st @@ -30,15 +30,6 @@ TiddlyWiki class >> fromJSONUrl: anUrlString [ name: anUrlString ] -{ #category : #accessing } -TiddlyWiki class >> installJsonExporter [ - ZnClient "Descarga el archivo - https://mutabit.com/repos.fossil/mutabit/uv/wiki/scripts/exportJsonFile - a la subcarpeta del wiki ./scripts/exportJsonFile. - y lo hace ejecutable. - " -] - { #category : #accessing } TiddlyWiki >> addToConfigFile [ | cleaned newConfig | @@ -165,10 +156,19 @@ TiddlyWiki >> exportJSONFile [ { #category : #accessing } TiddlyWiki >> exportJSONFileOptimized [ - | exporter | - exporter := self file parent / 'scripts' / 'export' / 'exportJsonFile'. - exporter exists ifFalse: [ self class installJsonExporter]. + + | exporter wikiFolder | + wikiFolder := self file parent. + exporter := wikiFolder / 'scripts' / 'exportJsonFile'. + exporter exists ifFalse: [ self installJsonExporter]. "Ejecutar el exportador de JSON con OSSubprocess." + OSSUnixSubprocess new + command: 'fossil'; + arguments: {}; + workingDirectory: wikiFolder; + redirectStdout; + redirectStderr; + runAndWaitOnExitDo: [ :process :outString | ^ outString ] ] { #category : #accessing } @@ -288,6 +288,19 @@ TiddlyWiki >> importJSONFile [ self fromDictionary: tiddlersDict ] +{ #category : #accessing } +TiddlyWiki >> installJsonExporter [ + + ZnClient new + url: 'https://mutabit.com/repos.fossil/mutabit/uv/wiki/scripts/exportJsonFile'; + downloadTo: self file parent / 'scripts' / 'exportJsonFile' + "Descarga el archivo + https://mutabit.com/repos.fossil/mutabit/uv/wiki/scripts/exportJsonFile + a la subcarpeta del wiki ./scripts/exportJsonFile. + y lo hace ejecutable. + " +] + { #category : #accessing } TiddlyWiki >> jsonFile [ ^ jsonFile ifNil: [