|
@ -4,7 +4,6 @@ import * as fs from 'fs'; |
|
|
import * as path from 'path'; |
|
|
import * as path from 'path'; |
|
|
import fetch from 'node-fetch'; |
|
|
import fetch from 'node-fetch'; |
|
|
import * as checker from 'license-checker-rseidelsohn'; |
|
|
import * as checker from 'license-checker-rseidelsohn'; |
|
|
import { spawn } from 'child_process'; |
|
|
|
|
|
|
|
|
|
|
|
/** @typedef { { licenses: string; repository: string; licenseFile: string } } PackageInfo **/ |
|
|
/** @typedef { { licenses: string; repository: string; licenseFile: string } } PackageInfo **/ |
|
|
|
|
|
|
|
@ -65,7 +64,7 @@ async function generateThirdpartyNotices(packages) { |
|
|
|
|
|
|
|
|
let license; |
|
|
let license; |
|
|
if (data.licenseFile.startsWith('https://')) { |
|
|
if (data.licenseFile.startsWith('https://')) { |
|
|
const response = await fetch(data.licenseFile); |
|
|
|
|
|
|
|
|
const response = await fetch(data.licenseFile, { method: 'GET' }); |
|
|
license = await response.text(); |
|
|
license = await response.text(); |
|
|
} else { |
|
|
} else { |
|
|
license = fs.readFileSync(data.licenseFile, 'utf8'); |
|
|
license = fs.readFileSync(data.licenseFile, 'utf8'); |
|
|