mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-11-18 16:25:13 +00:00
Add first release of AWS plugin
Tools for working with Amazon Web Services: * Templates for saving a TiddlyWiki as a single JavaScript file in a ZIP file that can be executed as an AWS Lambda function. In this form, TiddlyWiki is a self contained single file containing both code and data, just like the standalone HTML file configuration * Commands that can be used to interact with AWS services, under both the Node.js and Lambda configurations of TiddlyWiki
This commit is contained in:
37
plugins/tiddlywiki/aws/modules/init.js
Normal file
37
plugins/tiddlywiki/aws/modules/init.js
Normal file
@@ -0,0 +1,37 @@
|
||||
/*\
|
||||
title: $:/plugins/tiddlywiki/aws/init.js
|
||||
type: application/javascript
|
||||
module-type: startup
|
||||
|
||||
AWS initialisation
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
// Export name and synchronous status
|
||||
exports.name = "aws-init";
|
||||
exports.before = ["startup"];
|
||||
exports.synchronous = true;
|
||||
|
||||
exports.startup = function() {
|
||||
var logger = new $tw.utils.Logger("aws");
|
||||
if($tw.node) {
|
||||
try {
|
||||
require("aws-sdk");
|
||||
} catch(e) {
|
||||
logger.alert("The plugin 'tiddlywiki/aws' requires the aws-sdk to be installed. Run 'npm install aws-sdk' in the root of the TiddlyWiki repository");
|
||||
}
|
||||
}
|
||||
if(!$tw.modules.titles["$:/plugins/tiddlywiki/async/async.js"]) {
|
||||
logger.alert("The plugin 'tiddlywiki/aws' requires the 'tiddlywiki/async' plugin to be installed");
|
||||
}
|
||||
if(!$tw.modules.titles["$:/plugins/tiddlywiki/jszip/jszip.js"]) {
|
||||
logger.alert("The plugin 'tiddlywiki/aws' requires the 'tiddlywiki/jszip' plugin to be installed");
|
||||
}
|
||||
};
|
||||
|
||||
})();
|
||||
Reference in New Issue
Block a user