From d0bd76072b6ed529b25ea6002f2a2183bb639db9 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 7 Apr 2015 15:58:44 -0700 Subject: [PATCH] Inline platform system menu --- build/tasks/compile-packages-slug-task.coffee | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/build/tasks/compile-packages-slug-task.coffee b/build/tasks/compile-packages-slug-task.coffee index 4e24f948e..ed9c2e9e4 100644 --- a/build/tasks/compile-packages-slug-task.coffee +++ b/build/tasks/compile-packages-slug-task.coffee @@ -6,6 +6,13 @@ _ = require 'underscore-plus' module.exports = (grunt) -> {spawn, rm} = require('./task-helpers')(grunt) + getMenu = (appDir) -> + menusPath = path.join(appDir, 'menus') + menuPath = path.join(menusPath, process.platform) + menu = CSON.readFileSync(menuPath) if fs.isFileSync(menuPath) + rm menusPath + menu ? {} + grunt.registerTask 'compile-packages-slug', 'Add bundled package metadata information to the main package.json file', -> appDir = fs.realpathSync(grunt.config.get('atom.appDir')) @@ -50,5 +57,6 @@ module.exports = (grunt) -> metadata = grunt.file.readJSON(path.join(appDir, 'package.json')) metadata._atomPackages = packages + metadata._menu = getMenu(appDir) grunt.file.write(path.join(appDir, 'package.json'), JSON.stringify(metadata))