-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Autoinstall self-cleanup, add additional diagnostic data to generated…
… package.json
- Loading branch information
Showing
8 changed files
with
55 additions
and
23 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
|
||
### Added | ||
|
||
- TBA | ||
- Added support for automated dependency management (`autoinstall`) | ||
|
||
--- | ||
|
||
|
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,23 @@ | ||
let { mkdirSync, renameSync } = require('fs') | ||
let { join } = require('path') | ||
|
||
// Best effort local artifact cleanup | ||
module.exports = function cleanup (installed) { | ||
if (installed) { | ||
try { | ||
installed.forEach(i => { | ||
let { dir, file, remove } = i | ||
if (file === 'package.json') { | ||
let dest = join(dir, 'node_modules', '_arc-autoinstall') | ||
mkdirSync(dest, { recursive: true }) | ||
remove.forEach(f => { | ||
let before = join(dir, f) | ||
let after = join(dest, f) | ||
renameSync(before, after) | ||
}) | ||
} | ||
}) | ||
} | ||
catch (err) { null } // Swallow errors, we may have to bubble something else | ||
} | ||
} |
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