Remove package's package.json from cache

This file is inlined in the main package.json
This commit is contained in:
Kevin Sawicki
2014-10-21 12:04:41 -07:00
parent 345c0f670c
commit a1828fa3a6

View File

@@ -1,6 +1,7 @@
path = require 'path'
CSON = require 'season'
fs = require 'fs-plus'
_ = require 'underscore-plus'
module.exports = (grunt) ->
{spawn, rm} = require('./task-helpers')(grunt)
@@ -18,7 +19,10 @@ module.exports = (grunt) ->
metadata = grunt.file.readJSON(metadataPath)
continue unless metadata?.engines?.atom?
moduleCache = metadata._atomModuleCache ? {}
rm metadataPath
_.remove(moduleCache.extensions?['.json'] ? [], 'package.json')
for property in ['_from', '_id', 'dist', 'readme', 'readmeFilename']
delete metadata[property]
@@ -37,6 +41,10 @@ module.exports = (grunt) ->
packages[metadata.name] = pack
for extension, paths of moduleCache.extensions
if paths.length is 0
delete metadata._atomModuleCache?.extensions[extension]
metadata = grunt.file.readJSON(path.join(appDir, 'package.json'))
metadata._atomPackages = packages