From 5916758d3059a2ccfc95d63abf06ab62dcbf3d75 Mon Sep 17 00:00:00 2001 From: edsilv Date: Mon, 30 Apr 2018 22:49:41 +0100 Subject: [PATCH] fixed generated readme url --- .vscode/launch.json | 2 +- index.js | 9 ++++++--- package.json | 2 +- scaffold/index.html | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 5bdacd1..96dc06e 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -11,7 +11,7 @@ "program": "${workspaceFolder}/index.js", "args": [ "collection", - "-u", "http://test.com/collection" + "-u", "http://username.github.io/repo/collection" ] } ] diff --git a/index.js b/index.js index ffd8b38..85b62a4 100644 --- a/index.js +++ b/index.js @@ -26,7 +26,7 @@ async function execCli(env, options) { ncp.limit = 16; - const scaffoldTarget = './'; + const scaffoldTarget = './scaffoldtest'; const scaffoldFilesPath = join(__dirname, 'scaffold'); ncp(scaffoldFilesPath, scaffoldTarget, { @@ -43,9 +43,12 @@ async function execCli(env, options) { url = url.substr(0, url.lastIndexOf('/')); } + const explorerurl = url.substr(0, url.lastIndexOf('/')); + const manifesturl = url + '/index.json'; + // replace [url] - replaceInFile(join(scaffoldTarget, 'README.md'), /\[url\]/g, url); - replaceInFile(join(scaffoldTarget, 'index.html'), /\[url\]/g, url); + replaceInFile(join(scaffoldTarget, 'README.md'), /\[url\]/g, explorerurl); + replaceInFile(join(scaffoldTarget, 'index.html'), /\[url\]/g, manifesturl); console.log('finished scaffolding'); }); diff --git a/package.json b/package.json index 01b34b6..b88127a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "biiif-cli", - "version": "0.0.21", + "version": "0.0.22", "description": "A CLI to Build Static IIIF Collections", "main": "index.js", "bin": { diff --git a/scaffold/index.html b/scaffold/index.html index 7429696..826f77c 100644 --- a/scaffold/index.html +++ b/scaffold/index.html @@ -16,7 +16,7 @@