Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ghcrawler/providers/storage/file.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

const fs = require('fs')
const path = require('path')
const mkdirp = require('mkdirp')
const { mkdirpSync } = require('mkdirp')

// TODO finish the implementation of the relevant methods

Expand All @@ -22,7 +22,7 @@ class FileStore {
// const type = document._metadata.type
const urn = document._metadata.links.self.href
const filePath = this._getPath(urn)
mkdirp.sync(path.dirname(filePath))
mkdirpSync(path.dirname(filePath))
return new Promise((resolve, reject) =>
fs.writeFile(filePath, JSON.stringify(document, null, 2), error => (error ? reject(error) : resolve(document)))
)
Expand Down
30 changes: 24 additions & 6 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"lodash": "^4.17.23",
"luxon": "^3.7.2",
"memory-cache": "^0.2.0",
"mkdirp": "^0.5.1",
"mkdirp": "^3.0.1",
"morgan": "^1.10.1",
"node-html-parser": "^5.3.3",
"node-uuid": "^1.4.8",
Expand Down
4 changes: 2 additions & 2 deletions providers/fetch/nugetFetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
const AbstractFetch = require('./abstractFetch')
const { trimStart, clone, get } = require('lodash')
const fs = require('fs')
const mkdirp = require('mkdirp')
const { mkdirp } = require('mkdirp')
const path = require('path')
const { promisify } = require('util')
const requestRetry = require('requestretry').defaults({ maxAttempts: 3, fullResponse: true })
Expand Down Expand Up @@ -145,7 +145,7 @@ class NuGetFetch extends AbstractFetch {
async _downloadLicense({ dirName, licenseUrl }) {
if (licenseUrl.toLowerCase().includes('license_url_here_or_delete_this_line')) return
const downloadedLicenseDirName = path.join(dirName, 'clearlydefined', 'downloaded')
await promisify(mkdirp)(downloadedLicenseDirName)
await mkdirp(downloadedLicenseDirName)
const { body, statusCode } = await requestRetry.get(licenseUrl)
if (statusCode !== 200) return
await promisify(fs.writeFile)(path.join(downloadedLicenseDirName, 'LICENSE'), body)
Expand Down