-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #115 from casanet/development
Fix packaging to match 'arm' machines
- Loading branch information
Showing
9 changed files
with
305 additions
and
3,322 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const fse = require('fs-extra'); | ||
const path = require('path'); | ||
|
||
const fixModulesLicenceSection = async modulesPath => { | ||
try { | ||
const nodeModulesDirs = await fse.promises.readdir(modulesPath); | ||
|
||
const dirs = [...nodeModulesDirs]; | ||
for (const dir of dirs) { | ||
try { | ||
const packagePath = path.join(modulesPath, dir, 'package.json'); | ||
const package = await fse.readJSON(packagePath); | ||
if (package.license) { | ||
continue; | ||
} | ||
package.license = 'ISC'; | ||
fse.writeJSON(packagePath, package); | ||
console.log(`package '${packagePath}' fixed`); | ||
} catch (error) {} | ||
} | ||
} catch (error) {} | ||
}; | ||
|
||
const fixProjectModules = async () => { | ||
await fixModulesLicenceSection('node_modules'); | ||
await fixModulesLicenceSection(path.join('node_modules', 'npm', 'node_modules')); | ||
}; | ||
|
||
fixProjectModules(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters