Skip to content

Commit

Permalink
Merge pull request #9 from orta/curl_check
Browse files Browse the repository at this point in the history
Adds a curl check on launch
  • Loading branch information
sandersn committed Nov 29, 2021
1 parent 31e17e2 commit 788adb5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions packages/dts-critic/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@ const fs = require("fs");
const path = require("path");
const download = require("download-file-sync");
const semver = require("semver");
const commandExistsSync = require("command-exists").sync;

/**
* @param {string} dtsPath
* @param {string} [sourcePath]
*/
function dtsCritic(dtsPath, sourcePath) {
if (!commandExistsSync('curl')) {
throw new Error("You need to have curl installed to run dts-critic, you can get it from https://curl.haxx.se/download.html")
}

const dts = fs.readFileSync(dtsPath, "utf-8");
let header;
try {
Expand Down
7 changes: 6 additions & 1 deletion packages/dts-critic/package-lock.json

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

1 change: 1 addition & 0 deletions packages/dts-critic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"author": "Nathan Shively-Sanders",
"description": "Checks a new .d.ts against the Javascript source and tells you what problems it has",
"dependencies": {
"command-exists": "^1.2.8",
"definitelytyped-header-parser": "^1.2.0",
"download-file-sync": "^1.0.4",
"semver": "^6.2.0",
Expand Down

0 comments on commit 788adb5

Please sign in to comment.