Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(responses): response xml and json files #247

Merged
merged 1 commit into from
May 5, 2017

Conversation

cnishina
Copy link
Member

@cnishina cnishina commented May 4, 2017

  • on clean, remove responses
  • on update, if the size is 0 then get a new response

@cnishina cnishina force-pushed the fix_responses branch 3 times, most recently from 33dc652 to a739eca Compare May 4, 2017 17:52
- on clean, remove responses
- on update, if the size is 0 then get a new response
@cnishina cnishina requested a review from heathkit May 4, 2017 23:03
@@ -169,8 +170,13 @@ export abstract class GithubApiConfigSource extends JsonConfigSource {
try {
let contents = fs.readFileSync(fileName).toString();
let timestamp = new Date(fs.statSync(fileName).mtime).getTime();
let size = fs.statSync(fileName).size;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not fs.existsSync()? Not a big deal, just seems clearer.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

readFileSync would throw if the file does not exist. The file exists but the file is empty. I think I could also do let size = contents.length;

@cnishina cnishina merged commit 708ade3 into angular:master May 5, 2017
@cnishina cnishina mentioned this pull request May 5, 2017
@cnishina cnishina deleted the fix_responses branch December 11, 2018 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants