Better install
This commit is contained in:
parent
2babfbdc6a
commit
98bfdbaa06
|
@ -5,9 +5,7 @@ _Helps locating elements in simple HTML pages_
|
|||
## Installation
|
||||
|
||||
```sh
|
||||
git clone https://gitea.tforgione.fr/tforgione/locator
|
||||
cd locator
|
||||
npm install
|
||||
npm install --global git+https://gitea.tforgione.fr/tforgione/locator.git
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
|
6
index.js
6
index.js
|
@ -6,6 +6,12 @@ const puppeteer = require('puppeteer');
|
|||
|
||||
async function main() {
|
||||
|
||||
if (process.argv[2] === undefined) {
|
||||
console.error("This program expects an argument.");
|
||||
console.error("USAGE: locator <path-to-HTML-file>");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
// Path to the HTML file to analyse (given as relative path from current directory)
|
||||
// We need the full path so that puppeteer is able to access it
|
||||
const path = process.argv[2].startsWith('/') ? process.argv[2] : process.cwd() + '/' + process.argv[2];
|
||||
|
|
|
@ -10,6 +10,9 @@
|
|||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"puppeteer": "^19.7.1"
|
||||
},
|
||||
"bin": {
|
||||
"locator": "index.js"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/code-frame": {
|
||||
|
|
Loading…
Reference in New Issue