Skip to content

Commit 2679198

Browse files
authored
Merge pull request #52 from shriyanss/dev
v1.2.1 ### Added ### Changed ### Fixed - Add try-catch block when checking version from GH for rules
2 parents d3385b6 + 49c7889 commit 2679198

File tree

4 files changed

+24
-10
lines changed

4 files changed

+24
-10
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Change Log
22

3+
## 1.2.1 - 2025.08.16
4+
5+
### Added
6+
7+
### Changed
8+
9+
### Fixed
10+
11+
- Add try-catch block when checking version from GH for rules
12+
313
## 1.2.1-beta.2 - 2025.08.10
414

515
### Added

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@shriyanss/js-recon",
3-
"version": "1.2.1-beta.2",
3+
"version": "1.2.1",
44
"description": "JS Recon Tool",
55
"main": "build/index.js",
66
"type": "module",

src/analyze/helpers/initRules.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,18 @@ const initRules = async () => {
7070

7171
// also, if the version.txt exist, check if the version.txt is latest as per the latest release on github
7272
const version = fs.readFileSync(versionPath, "utf8").trim();
73-
const response = await fetch("https://api.github.com/repos/shriyanss/js-recon-rules/releases/latest");
74-
const release = await response.json();
75-
const release_tag_name = release.tag_name;
76-
if (`v${version}` !== release_tag_name) {
77-
console.log(chalk.yellow("[!] Rules are not up to date. Downloading latest version..."));
78-
// remove the rules directory
79-
fs.rmSync(path.join(homeDir, "/.js-recon/rules"), { recursive: true });
80-
await downloadRules(homeDir);
73+
try {
74+
const response = await fetch("https://api.github.com/repos/shriyanss/js-recon-rules/releases/latest");
75+
const release = await response.json();
76+
const release_tag_name = release.tag_name;
77+
if (`v${version}` !== release_tag_name) {
78+
console.log(chalk.yellow("[!] Rules are not up to date. Downloading latest version..."));
79+
// remove the rules directory
80+
fs.rmSync(path.join(homeDir, "/.js-recon/rules"), { recursive: true });
81+
await downloadRules(homeDir);
82+
}
83+
} catch {
84+
console.error(chalk.red("[!] An error occured when fetching rules from GitHub"));
8185
}
8286
};
8387

src/globalConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const githubURL = "https://github.com/shriyanss/js-recon";
22
const modulesDocs = "https://js-recon.io/docs/category/modules";
3-
const version = "1.2.1-beta.2";
3+
const version = "1.2.1";
44
const toolDesc = "JS Recon Tool";
55
const axiosNonHttpMethods = ["isAxiosError"]; // methods available in axios, which are not for making HTTP requests
66

0 commit comments

Comments
 (0)