Skip to content

Commit

Permalink
New bug Identified and fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
darsan-in committed Jun 20, 2024
1 parent e48aab3 commit 13d51cd
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 3 deletions.
22 changes: 22 additions & 0 deletions CONTRIBUTING
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Contributing to HAWK JS

First off, thank you for considering contributing to HAWK JS! We welcome contributions from the community.

## License Agreement

By contributing to this project, you agree that your contributions will be licensed under the Apache License, Version 2.0. This means that any code or documentation you submit will be covered by the same license as the rest of the project.

## How to Contribute

1. Fork the repository.
2. Create a new branch for your feature or bugfix.
3. Make your changes in the new branch.
4. Submit a pull request to the main repository.

Please ensure that your contributions adhere to our coding standards and include appropriate tests.

## Contact

For any questions, please open an issue or contact [CRESTEEM](https://www.cresteem.com/).

Mail us to [email protected]
64 changes: 64 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,67 @@
![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/cresteem/HawK-JS/test.yaml?branch=main&style=flat&logo=github&logoColor=black&logoSize=auto&label=Test&labelColor=white&color=rgb(80%2C200%2C10))


Available on NPM:

![NPM Version](https://img.shields.io/npm/v/%40cresteem%2Fhawk-js?style=flat&logo=rocket&logoColor=black&logoSize=auto&label=Richie%20JS%20Version&labelColor=white)


![NPM Downloads](https://img.shields.io/npm/d18m/%40cresteem%2Fhawk-js?style=flat&logo=rocket&logoColor=black&logoSize=auto&label=Download%20Counts&labelColor=white&color=rgb(80,200,10))


## 🧑🏻 Maintainer
[@iamspdarsan](https://github.com/iamspdarsan) - [LinkedIN](https://in.linkedin.com/in/iamspdarsan) - [Github](https://github.com/iamspdarsan)

## ⚖️ License

HAWK JS © 2024 by 🚀[CRESTEEM](https://www.cresteem.com/) is licensed under [APACHE LICENSE VERSION 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt)

## 💁🏻 Contribution

By contributing to this project, you agree that your contributions will be licensed under the Apache License, Version 2.0. You can find the full text of the license in the LICENSE file located in the root directory of this project.

For more about contribution check [CONTRIBUTING](./CONTRIBUTING) file.

### ©️ Attribution Requirements

In addition to the terms of the Apache License, Version 2.0, you are required to provide the following attribution in any use, reproduction, and distribution of this software:

"This software includes HAWK JS © 2024 by [CRESTEEM](https://www.cresteem.com/). Licensed under the Apache License, Version 2.0."

This attribution must be displayed in a prominent location in any documentation, notices, or marketing materials accompanying the distribution or use of this software.

## Installation
```bash
yarn add @cresteem/richie-js

or

npm i @cresteem/richie-js
```

## 👨🏻‍💻 CLI

```bash
hawk -s indexnow

or

hawk -s gindex

or

hawk -s gwebmaster

or

hawk -s gwebmaster2
```

[learn more about Hawk JS](https://www.cresteem.com/opensource/hawk-js)

## 🌐 Documenation Website
[https://www.cresteem.com/opensource/hawk-js](https://www.cresteem.com/opensource/hawk-js)

## References

- https://www.robotstxt.org/
Expand Down
1 change: 1 addition & 0 deletions hawk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,6 @@ export const utilities = {
getUpdatedRoutesPath,
makeRobot,
makeSitemap,
getLastRunTimeStamp,
_makeSitemapRobot,
};
17 changes: 14 additions & 3 deletions lib/indexnow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,20 @@ function _makeSecretKey(): string {
}

async function _secretKeyManager(): Promise<string> {
const ranStatusObject = JSON.parse(
readFileSync(constants.ranStatusFile, { encoding: "utf8" }),
);
let ranStatusObject: ranStatusFileStructute =
{} as ranStatusFileStructute;

try {
ranStatusObject = JSON.parse(
readFileSync(constants.ranStatusFile, { encoding: "utf8" }),
);
} catch (err: any) {
if (err.code === "ENOENT") {
writeFileSync(constants.ranStatusFile, JSON.stringify({}, null, 2), {
encoding: "utf8",
});
}
}

const oldSecretKey: string = ranStatusObject.secretKey ?? "";

Expand Down

0 comments on commit 13d51cd

Please sign in to comment.