Skip to content

Commit

Permalink
New version 0.0.31 Read more https://github.com/mappable-world/mappab…
Browse files Browse the repository at this point in the history
  • Loading branch information
xdan committed Mar 19, 2024
1 parent c3a1f28 commit e02ca70
Show file tree
Hide file tree
Showing 3 changed files with 8 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.30",
"version": "0.0.31",
"description": "Library for encapsulating the logic of autotests and building packages mappable.world js API",
"main": "dist/index.js",
"dependencies": {
Expand Down
5 changes: 5 additions & 0 deletions src/controllers/example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ function copyAndReplace(input: string, output: string, replace: Record<string, u
return copyAndReplace(path.resolve(input, file.name), path.resolve(output, file.name), replace);
}

if (/\.(webp|png|jpg|jpeg|gif)$/i.test(file.name)) {
fs.copyFileSync(path.resolve(input, file.name), path.resolve(output, file.name));
return;
}

const content = fs.readFileSync(path.resolve(input, file.name), 'utf8');
const newContent = content.replace(/%(\w+)%/gi, (match, key) => {
return replace[key.trim()] !== undefined ? replace[key.trim()].toString() : match;
Expand Down

0 comments on commit e02ca70

Please sign in to comment.