Skip to content

Commit

Permalink
Merge pull request #2 from ioncakephper:chore/create-cli-app
Browse files Browse the repository at this point in the history
Chore/create-cli-app
  • Loading branch information
ioncakephper authored Dec 17, 2024
2 parents c70b032 + dc0d5c0 commit c7d0c55
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 21 deletions.
27 changes: 9 additions & 18 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,18 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [

{
"type": "node",
"name": "vscode-jest-tests.v2.insert-file-tag",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceFolder}\\bin\\cli.js",
"args": [
"--runInBand",
"--watchAll=false",
"--testNamePattern",
"${jest.testNamePattern}",
"--runTestsByPath",
"${jest.testFile}"
"SAMPLE_README.md"
],
"request": "launch",
"skipFiles": [
"<node_internals>/**"
],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
"program": "${workspaceFolder}/node_modules/.bin/jest",
"windows": {
"program": "${workspaceFolder}/node_modules/jest/bin/jest"
}
"type": "node"
}

]
}
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Changelog

*Changelog created using the [Simple Changelog](https://marketplace.visualstudio.com/items?itemName=tobiaswaelde.vscode-simple-changelog) extension for VS Code.*

## [1.0.0] - 2024-12-16
### Added
- Add instags in bin property
- Added cli.js in bin folder
26 changes: 26 additions & 0 deletions bin/cli.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env node

const { Command } = require('commander');
const { processAndSaveFileWithTags } = require('../src/source-processor');
const packageJson = require('../package.json');
const path = require('path');

const program = new Command();

program
.name(packageJson.name)
.version(packageJson.version)
.description(packageJson.description)
.argument('<filename>', 'file to process for insert tags')
.option('-o, --output <output>', 'output filename', '')
.action((filename, options) => {
const outputFilename = options.output || filename;
processAndSaveFileWithTags(filename, outputFilename);
});

program.parse(process.argv);

if (!program.args.length) {
program.help();
}

13 changes: 13 additions & 0 deletions package-lock.json

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

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
"automation"
],
"main": "index.js",
"bin": {
"instags": "../bin/cli.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/ioncakephper/insert-file-tag.git"
Expand All @@ -27,6 +30,7 @@
"test": "jest"
},
"dependencies": {
"commander": "^12.1.0",
"fs": "^0.0.1-security",
"fs-extra": "^11.1.1"
},
Expand Down
1 change: 0 additions & 1 deletion source.txt

This file was deleted.

1 change: 0 additions & 1 deletion target.txt

This file was deleted.

1 change: 0 additions & 1 deletion test.txt

This file was deleted.

0 comments on commit c7d0c55

Please sign in to comment.