Skip to content

Commit

Permalink
New version 0.0.12 Read more https://github.com/mappable-world/mappab…
Browse files Browse the repository at this point in the history
  • Loading branch information
xdan committed Sep 18, 2023
1 parent 7d06b1b commit ced3764
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mappable-world/mappable-cli",
"version": "0.0.11",
"version": "0.0.12",
"description": "Library for encapsulating the logic of autotests and building packages mappable.world js API",
"main": "dist/index.js",
"dependencies": {
Expand Down
10 changes: 10 additions & 0 deletions src/controllers/example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ export async function example() {

const readme = fs.readFileSync(readmeFile, 'utf8');

const packageFile = path.resolve(process.cwd(), 'package.json');

const pkg = {
version: '',
};
if (!fs.existsSync(packageFile) || !fs.statSync(packageFile).isFile()) {
Object.assign(pkg, JSON.parse(fs.readFileSync(packageFile, 'utf8')));
}

copyAndReplace(input, output, process.env);

fs.writeFileSync(
Expand All @@ -50,6 +59,7 @@ export async function example() {
// prettier-ignore
.replace(/%README%/, marked(readme))
.replace(/%REFERENCES%/, '')
.replace(/%VERSION%/, pkg.version)
);
}

Expand Down
4 changes: 4 additions & 0 deletions template/example/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ body,
width: 1024px;
margin: 0 auto;
}

.version {
font-size: 14px;
}
1 change: 1 addition & 0 deletions template/example/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
</head>
<body>
<iframe width="100%" height="500px" src="./vanilla.html" frameborder="0"></iframe>
<div class="version">%VERSION%</div>
<div class="content">%README%</div>
<div class="references">%REFERENCES%</div>
<link
Expand Down

0 comments on commit ced3764

Please sign in to comment.