Skip to content

Commit da12eea

Browse files
committed
* chore(launch.json): update program path in launch configuration
* fix(README.md): fix error in example code * chore(cli.js): update path to source-processor module * fix(package-lock.json): update path to cli.js in bin * chore(package.json): update path to cli.js in bin
1 parent 9783f80 commit da12eea

File tree

5 files changed

+16
-13
lines changed

5 files changed

+16
-13
lines changed

.vscode/launch.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
"configurations": [
77
{
88
"name": "Launch Program",
9-
"program": "${workspaceFolder}\\bin\\cli.js",
9+
"program": "${workspaceFolder}\\cli.js",
1010
"args": [
11-
"SAMPLE_README.md"
11+
"README.md"
1212
],
1313
"request": "launch",
1414
"skipFiles": [

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ The `insert-file-tag` package is a Node.js utility that simplifies the process o
99
The package works by parsing your document, looking for special HTML-style comment tags that indicate the path to the file you want to insert. For example:
1010

1111
```html
12-
<!-- ::insert file="path/to/code.js" -->
13-
<!-- :/insert -->
12+
<!-- Error processing file: path/to/code.js -->
13+
14+
1415
```
1516

1617
The content of path/to/code.js will be inserted between these tags when the utility is run. This keeps your main document clean and maintainable while allowing you to include dynamic content from other sources. insert-file-tag supports various file types and can be easily integrated into your build process.

bin/cli.js renamed to cli.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/usr/bin/env node
22

33
const { Command } = require('commander');
4-
const { processAndSaveFileWithTags } = require('../src/source-processor');
5-
const packageJson = require('../package.json');
4+
const { processAndSaveFileWithTags } = require('./src/source-processor');
5+
const packageJson = require('./package.json');
66
const path = require('path');
77

88
const program = new Command();
@@ -15,7 +15,13 @@ program
1515
.option('-o, --output <output>', 'output filename', '')
1616
.action((filename, options) => {
1717
const outputFilename = options.output || filename;
18-
processAndSaveFileWithTags(filename, outputFilename);
18+
try {
19+
processAndSaveFileWithTags(filename, outputFilename);
20+
} catch (error) {
21+
console.error(error);
22+
process.exit(1);
23+
}
24+
1925
});
2026

2127
program.parse(process.argv);

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@
1111
],
1212
"main": "index.js",
1313
"bin": {
14-
<<<<<<< HEAD
15-
"instags": "bin/cli.js"
16-
=======
17-
"instags": "../bin/cli.js"
18-
>>>>>>> c7d0c55980af70dda627f0972460ffbf4a5a1937
14+
"instags": "cli.js"
1915
},
2016
"repository": {
2117
"type": "git",

0 commit comments

Comments
 (0)