]> khamidou — GitHub mirrors - electron.git/commitdiff
Clean the init.coffee
authorCheng Zhao <zcbenz@gmail.com>
Thu, 22 Jan 2015 01:38:26 +0000 (17:38 -0800)
committerCheng Zhao <zcbenz@gmail.com>
Thu, 22 Jan 2015 01:38:26 +0000 (17:38 -0800)
atom/browser/lib/init.coffee
atom/renderer/lib/init.coffee

index 3519a2cb09983fd843ea84c82630a01edce90943..caf428fde079163a8e8e56b27e7193a4a7ba3266 100644 (file)
@@ -24,7 +24,7 @@ globalPaths = module.globalPaths
 globalPaths.push path.join process.resourcesPath, 'atom', 'browser', 'api', 'lib'
 
 # Import common settings.
-require path.resolve(__dirname, '..', '..', 'common', 'lib', 'init.js')
+require path.resolve(__dirname, '..', '..', 'common', 'lib', 'init')
 
 if process.platform is 'win32'
   # Redirect node's console to use our own implementations, since node can not
@@ -52,7 +52,8 @@ process.on 'uncaughtException', (error) ->
   require('dialog').showErrorBox 'A JavaScript error occured in the browser process', message
 
 # Emit 'exit' event on quit.
-require('app').on 'quit', ->
+app = require 'app'
+app.on 'quit', ->
   process.emit 'exit'
 
 # Load the RPC server.
@@ -77,7 +78,6 @@ for packagePath in searchPaths
 throw new Error("Unable to find a valid app") unless packageJson?
 
 # Set application's version.
-app = require 'app'
 app.setVersion packageJson.version if packageJson.version?
 
 # Set application's name.
@@ -90,14 +90,14 @@ else if packageJson.name?
 if packageJson.desktopName?
   app.setDesktopName packageJson.desktopName
 else
-  app.setDesktopName '#{app.getName()}.desktop'
+  app.setDesktopName "#{app.getName()}.desktop"
 
 # Set the user path according to application's name.
 app.setPath 'userData', path.join(app.getPath('appData'), app.getName())
 app.setPath 'userCache', path.join(app.getPath('cache'), app.getName())
 
 # Load the chrome extension support.
-require './chrome-extension.js'
+require './chrome-extension'
 
 # Finally load app's main.js and transfer control to C++.
 module._load path.join(packagePath, packageJson.main), module, true
index 11f933a0a838418a839a033371fe76111013632c..eca509994ad04cd224b68db58a7cd7b5c291d7e9 100644 (file)
@@ -19,7 +19,7 @@ globalPaths.push path.join(process.resourcesPath, 'atom', 'renderer', 'api', 'li
 globalPaths.push path.join(process.resourcesPath, 'app')
 
 # Import common settings.
-require path.resolve(__dirname, '..', '..', 'common', 'lib', 'init.js')
+require path.resolve(__dirname, '..', '..', 'common', 'lib', 'init')
 
 # Process command line arguments.
 nodeIntegration = 'false'