Skip to content

Commit

Permalink
fixed generated readme url
Browse files Browse the repository at this point in the history
  • Loading branch information
edsilv committed Apr 30, 2018
1 parent 8126e46 commit 5916758
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"program": "${workspaceFolder}/index.js",
"args": [
"collection",
"-u", "http://test.com/collection"
"-u", "http://username.github.io/repo/collection"
]
}
]
Expand Down
9 changes: 6 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand All @@ -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');
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion scaffold/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<body>
<script>

var manifest = "[url]/index.json";
var manifest = "[url]";
var iiif, iiifExplorer;

function updateIIIFLink(manifestUrl) {
Expand Down

0 comments on commit 5916758

Please sign in to comment.