Comparar commits

...

25 Commits

Autor SHA1 Mensagem Data
Cheng Zhao 6d76596d95 Warn empty app dir 2015-02-05 14:45:13 -08:00
Cheng Zhao 9ae7de3c26 ⬆️ atom-shell@0.21.2 2015-02-05 14:45:13 -08:00
Cheng Zhao e0ff661170 Print errors that happened before task-bootstrap 2015-02-05 14:45:13 -08:00
Cheng Zhao 5ffa1e9603 ⬆️ atom-shell@0.21.1 2015-02-05 14:45:13 -08:00
Cheng Zhao 0f9244916e Do not set "cwd" for tasks
The task can be inside an asar archive, which is not allowed to be cwd.
2015-02-05 14:45:13 -08:00
Cheng Zhao 3f54cf9607 Generate asar archive after set-version task 2015-02-05 14:45:12 -08:00
Cheng Zhao 7c546df6e4 Add generate-asar task 2015-02-05 14:45:12 -08:00
Cheng Zhao 20582ad599 ⬆️ asar@0.2.2 2015-02-05 14:45:12 -08:00
Kevin Sawicki 728a8049d9 ⬆️ markdown-preview@0.134 2015-02-05 13:42:55 -08:00
Kevin Sawicki 77741b6f3f Set ATOM_HOME as early as possible in render process
Moves it from window-bootstrap.coffee to index.js so it runs before
the coffee cache is registered.

Refs #5412
2015-02-05 12:18:51 -08:00
Kevin Sawicki 4597dd5594 Add render process check for ATOM_HOME
Setting it in the browser process does not seem to make it into
the render processes on Linux.

Closes #5412
2015-02-05 12:11:13 -08:00
Kevin Sawicki 04d015a7e0 Use app.getHomeDir 2015-02-05 11:39:58 -08:00
Kevin Sawicki 4bd07be7d8 ⬆️ timecop@0.29 2015-02-05 10:55:06 -08:00
Kevin Sawicki 40de6a7114 Add executable value to desktop file template
Closes #5419
2015-02-05 10:12:30 -08:00
Kevin Sawicki 9100d20dc4 Merge pull request #5417 from atom/iz-fix-semver
Fix atom engine semver in upgrading docs
2015-02-05 08:55:35 -08:00
Ivan Žužak 4361b67214 Fix atom engine semver in upgrading docs 2015-02-05 15:07:16 +01:00
Kevin Sawicki 83c8d904cf 🎨 Add space before arrow 2015-02-04 17:44:33 -08:00
Kevin Sawicki 3257d17fc0 Merge pull request #5408 from atom/add-csharp
Add language-csharp to core packages
2015-02-04 17:28:19 -08:00
Kevin Sawicki fd1d872840 Prompt split editors to save on close
Previously an editor that was split into multiple panes would not
prompt to save correctly when the window was unloading.

This adds a new `windowCloseRequested` option passed through from the
beforeunload handler to the editor so that it can specially handle this
case.

Closes #5257
2015-02-04 17:14:46 -08:00
Kevin Sawicki c5b6b90c88 Normalize opened paths to handle ~
Closes #3829
2015-02-04 16:39:25 -08:00
Kevin Sawicki 9618ec45cf Remove unused require 2015-02-04 15:35:41 -08:00
Kevin Sawicki 6e3d41f433 Suppress deprecations in BufferedNodeProcess
This keeps it consistent with the render process which also suppresses
deprecations

Closes #5383
2015-02-04 15:27:17 -08:00
Kevin Sawicki 6f438ca7da ⬆️ language-csharp@0.5 2015-02-04 14:44:49 -08:00
Daniel Hengeveld c629eb73b2 Add language-csharp to core packages 2015-02-04 14:16:01 -08:00
Kevin Sawicki cbe5eff04c Tweak chocolatey instructions
chocolatey now uses the new installer
2015-02-04 13:35:47 -08:00
21 arquivos alterados com 141 adições e 41 exclusões
+2 -12
Ver Arquivo
@@ -24,18 +24,8 @@ Atom will automatically update when a new release is available.
You can also download an `atom-windows.zip` file from the [releases page](https://github.com/atom/atom/releases/latest).
The `.zip` version will not automatically update.
#### Uninstalling Chocolatey Version
The recommended installation of Atom on Windows used to be using [Chocolatey](https://chocolatey.org/packages/Atom/).
This is no longer recommended now that the Atom Windows installer & auto-updater
exists.
To switch from Chocolatey to the new installer:
* Upgrade to Atom 0.155 or above by running `cup Atom`
* Run `cuninst Atom` to uninstall the Chocolatey version of Atom
* This will not delete any of your installed packages or Atom config files.
* Download the latest [AtomSetup.exe installer](https://github.com/atom/atom/releases/latest).
* Double-click the downloaded file to install Atom
Using [chocolatey](https://chocolatey.org/)? Run `cinst Atom` to install
the latest version of Atom.
### Debian Linux (Ubuntu)
+2 -2
Ver Arquivo
@@ -224,7 +224,7 @@ module.exports = (grunt) ->
ciTasks = ['output-disk-space', 'download-atom-shell', 'build']
ciTasks.push('dump-symbols') if process.platform isnt 'win32'
ciTasks.push('set-version', 'check-licenses', 'lint')
ciTasks.push('set-version', 'check-licenses', 'lint', 'generate-asar')
ciTasks.push('mkdeb') if process.platform is 'linux'
ciTasks.push('create-windows-installer') if process.platform is 'win32'
ciTasks.push('test') if process.platform is 'darwin'
@@ -232,6 +232,6 @@ module.exports = (grunt) ->
ciTasks.push('publish-build')
grunt.registerTask('ci', ciTasks)
defaultTasks = ['download-atom-shell', 'build', 'set-version']
defaultTasks = ['download-atom-shell', 'build', 'set-version', 'generate-asar']
defaultTasks.push 'install' unless process.platform is 'linux'
grunt.registerTask('default', defaultTasks)
+1
Ver Arquivo
@@ -6,6 +6,7 @@
"url": "https://github.com/atom/atom.git"
},
"dependencies": {
"asar": "^0.2.2",
"async": "~0.2.9",
"donna": "1.0.7",
"formidable": "~1.0.14",
+19
Ver Arquivo
@@ -0,0 +1,19 @@
asar = require 'asar'
fs = require 'fs'
path = require 'path'
module.exports = (grunt) ->
{rm} = require('./task-helpers')(grunt)
grunt.registerTask 'generate-asar', 'Generate asar archive for the app', ->
done = @async()
appDir = grunt.config.get('atom.appDir')
unless fs.existsSync(appDir)
grunt.log.error 'The app has to be built before generating asar archive.'
return done(false)
asar.createPackage appDir, path.resolve(appDir, '..', 'app.asar'), (err) ->
return done(err) if err?
rm appDir
done()
+2 -2
Ver Arquivo
@@ -47,9 +47,9 @@ module.exports = (grunt) ->
{description} = grunt.file.readJSON('package.json')
iconName = path.join(shareDir, 'resources', 'app', 'resources', 'atom.png')
installDir = path.join(installDir, '.') # To prevent "Exec=/usr/local//share/atom/atom"
executable = path.join(shareDir, 'atom')
template = _.template(String(fs.readFileSync(desktopFile)))
filled = template({description, installDir, iconName})
filled = template({description, iconName, executable})
grunt.file.write(desktopInstallFile, filled)
+1 -1
Ver Arquivo
@@ -63,7 +63,7 @@ When you are deprecation free and all done converting, upgrade the `engines` fie
```json
{
"engines": {
"atom": ">=0.174.0, <2.0.0"
"atom": ">=0.174.0 <2.0.0"
}
}
```
+5 -4
Ver Arquivo
@@ -17,7 +17,7 @@
"url": "http://github.com/atom/atom/raw/master/LICENSE.md"
}
],
"atomShellVersion": "0.21.0",
"atomShellVersion": "0.21.2",
"dependencies": {
"6to5-core": "^3.0.14",
"async": "0.2.6",
@@ -31,7 +31,7 @@
"emissary": "^1.3.1",
"event-kit": "^1.0.2",
"first-mate": "^3.0.0",
"fs-plus": "^2.3.2",
"fs-plus": "^2.5",
"fstream": "0.1.24",
"fuzzaldrin": "^2.1",
"git-utils": "^3.0.0",
@@ -103,7 +103,7 @@
"incompatible-packages": "0.21.0",
"keybinding-resolver": "0.27.0",
"link": "0.30.0",
"markdown-preview": "0.133.0",
"markdown-preview": "0.134.0",
"metrics": "0.42.0",
"notifications": "0.26.0",
"open-on-github": "0.32.0",
@@ -116,7 +116,7 @@
"styleguide": "0.43.0",
"symbols-view": "0.81.0",
"tabs": "0.64.0",
"timecop": "0.28.0",
"timecop": "0.29.0",
"tree-view": "0.154.0",
"update-package-dependencies": "0.8.0",
"welcome": "0.21.0",
@@ -125,6 +125,7 @@
"language-c": "0.38.0",
"language-clojure": "0.10.0",
"language-coffee-script": "0.39.0",
"language-csharp": "0.5.0",
"language-css": "0.27.0",
"language-gfm": "0.63.0",
"language-git": "0.10.0",
+39
Ver Arquivo
@@ -0,0 +1,39 @@
path = require 'path'
BufferedNodeProcess = require '../src/buffered-node-process'
describe "BufferedNodeProcess", ->
it "executes the script in a new process", ->
exit = jasmine.createSpy('exitCallback')
output = ''
stdout = (lines) -> output += lines
error = ''
stderr = (lines) -> error += lines
args = ['hi']
command = path.join(__dirname, 'fixtures', 'script.js')
new BufferedNodeProcess({command, args, stdout, stderr, exit})
waitsFor ->
exit.callCount is 1
runs ->
expect(output).toBe 'hi'
expect(error).toBe ''
expect(args).toEqual ['hi']
it "suppresses deprecations in the new process", ->
exit = jasmine.createSpy('exitCallback')
output = ''
stdout = (lines) -> output += lines
error = ''
stderr = (lines) -> error += lines
command = path.join(__dirname, 'fixtures', 'script-with-deprecations.js')
new BufferedNodeProcess({command, stdout, stderr, exit})
waitsFor ->
exit.callCount is 1
runs ->
expect(output).toBe 'hi'
expect(error).toBe ''
+2
Ver Arquivo
@@ -0,0 +1,2 @@
require('fs').existsSync('hi');
process.stdout.write('hi');
+1
Ver Arquivo
@@ -0,0 +1 @@
process.stdout.write(process.argv[2]);
+22 -1
Ver Arquivo
@@ -1,5 +1,7 @@
{$, $$} = require '../src/space-pen-extensions'
path = require 'path'
fs = require 'fs-plus'
temp = require 'temp'
TextEditor = require '../src/text-editor'
WindowEventHandler = require '../src/window-event-handler'
@@ -54,7 +56,7 @@ describe "Window", ->
jasmine.unspy(TextEditor.prototype, "shouldPromptToSave")
beforeUnloadEvent = $.Event(new Event('beforeunload'))
describe "when pane items are are modified", ->
describe "when pane items are modified", ->
it "prompts user to save and calls atom.workspace.confirmClose", ->
editor = null
spyOn(atom.workspace, 'confirmClose').andCallThrough()
@@ -92,6 +94,25 @@ describe "Window", ->
$(window).trigger(beforeUnloadEvent)
expect(atom.confirm).toHaveBeenCalled()
describe "when the same path is modified in multiple panes", ->
it "prompts to save the item", ->
editor = null
filePath = path.join(temp.mkdirSync('atom-file'), 'file.txt')
fs.writeFileSync(filePath, 'hello')
spyOn(atom.workspace, 'confirmClose').andCallThrough()
spyOn(atom, 'confirm').andReturn(0)
waitsForPromise ->
atom.workspace.open(filePath).then (o) -> editor = o
runs ->
atom.workspace.getActivePane().splitRight(copyActiveItem: true)
editor.setText('world')
$(window).trigger(beforeUnloadEvent)
expect(atom.workspace.confirmClose).toHaveBeenCalled()
expect(atom.confirm.callCount).toBe 1
expect(fs.readFileSync(filePath, 'utf8')).toBe 'world'
describe ".unloadEditorWindow()", ->
it "saves the serialized state of the window so it can be deserialized after reload", ->
workspaceState = atom.workspace.serialize()
+2 -2
Ver Arquivo
@@ -5,7 +5,7 @@ AutoUpdateManager = require './auto-update-manager'
BrowserWindow = require 'browser-window'
Menu = require 'menu'
app = require 'app'
fs = require 'fs'
fs = require 'fs-plus'
ipc = require 'ipc'
path = require 'path'
os = require 'os'
@@ -342,6 +342,7 @@ class AtomApplication
# :window - {AtomWindow} to open file paths in.
openPath: ({pathToOpen, pidToKillWhenClosed, newWindow, devMode, safeMode, windowDimensions, window}={}) ->
{pathToOpen, initialLine, initialColumn} = @locationForPathToOpen(pathToOpen)
pathToOpen = fs.normalize(pathToOpen)
unless pidToKillWhenClosed or newWindow
pathToOpenStat = fs.statSyncNoException(pathToOpen)
@@ -414,7 +415,6 @@ class AtomApplication
openUrl: ({urlToOpen, devMode, safeMode}) ->
unless @packages?
PackageManager = require '../package-manager'
fs = require 'fs-plus'
@packages = new PackageManager
configDirPath: process.env.ATOM_HOME
devMode: devMode
+5 -8
Ver Arquivo
@@ -2,7 +2,7 @@ global.shellStartTime = Date.now()
crashReporter = require 'crash-reporter'
app = require 'app'
fs = require 'fs'
fs = require 'fs-plus'
path = require 'path'
optimist = require 'optimist'
nslog = require 'nslog'
@@ -43,10 +43,11 @@ start = ->
cwd = args.executedFrom?.toString() or process.cwd()
args.pathsToOpen = args.pathsToOpen.map (pathToOpen) ->
pathToOpen = fs.normalize(pathToOpen)
if cwd
path.resolve(cwd, pathToOpen.toString())
path.resolve(cwd, pathToOpen)
else
path.resolve(pathToOpen.toString())
path.resolve(pathToOpen)
setupCoffeeScript()
if args.devMode
@@ -77,11 +78,7 @@ setupCoffeeScript = ->
setupAtomHome = ->
return if process.env.ATOM_HOME
if process.platform is 'win32'
home = process.env.USERPROFILE
else
home = process.env.HOME
atomHome = path.join(home, '.atom')
atomHome = path.join(app.getHomeDir(), '.atom')
try
atomHome = fs.realpathSync(atomHome)
process.env.ATOM_HOME = atomHome
+3
Ver Arquivo
@@ -48,5 +48,8 @@ class BufferedNodeProcess extends BufferedProcess
options.env ?= Object.create(process.env)
options.env['ATOM_SHELL_INTERNAL_RUN_AS_NODE'] = 1
args = args?.slice() ? []
args.unshift(command)
args.unshift('--no-deprecation')
super({command: node, args, options, stdout, stderr, exit})
+2 -2
Ver Arquivo
@@ -152,12 +152,12 @@ class PaneContainer extends Model
saveAll: ->
pane.saveItems() for pane in @getPanes()
confirmClose: ->
confirmClose: (options) ->
allSaved = true
for pane in @getPanes()
for item in pane.getItems()
unless pane.promptToSaveItem(item)
unless pane.promptToSaveItem(item, options)
allSaved = false
break
+2 -2
Ver Arquivo
@@ -437,8 +437,8 @@ class Pane extends Model
destroyInactiveItems: ->
@destroyItem(item) for item in @getItems() when item isnt @activeItem
promptToSaveItem: (item) ->
return true unless item.shouldPromptToSave?()
promptToSaveItem: (item, options={}) ->
return true unless item.shouldPromptToSave?(options)
if typeof item.getURI is 'function'
uri = item.getURI()
+6 -1
Ver Arquivo
@@ -79,7 +79,7 @@ class Task
taskPath = taskPath.replace(/\\/g, "\\\\")
env = _.extend({}, process.env, {taskPath, userAgent: navigator.userAgent})
@childProcess = fork '--eval', [bootstrap], {env, cwd: __dirname}
@childProcess = fork '--eval', [bootstrap], {env, silent: true}
@on "task:log", -> console.log(arguments...)
@on "task:warn", -> console.warn(arguments...)
@@ -93,6 +93,11 @@ class Task
@childProcess.removeAllListeners()
@childProcess.on 'message', ({event, args}) =>
@emit(event, args...) if @childProcess?
# Catch the errors that happened before task-bootstrap.
@childProcess.stdout.on 'data', (data) ->
console.log data.toString()
@childProcess.stderr.on 'data', (data) ->
console.error data.toString()
# Public: Starts the task.
#
+5 -1
Ver Arquivo
@@ -641,7 +641,11 @@ class TextEditor extends Model
# Determine whether the user should be prompted to save before closing
# this editor.
shouldPromptToSave: -> @isModified() and not @buffer.hasMultipleEditors()
shouldPromptToSave: ({windowCloseRequested}={}) ->
if windowCloseRequested
@isModified()
else
@isModified() and not @buffer.hasMultipleEditors()
###
Section: Reading Text
+1 -1
Ver Arquivo
@@ -52,7 +52,7 @@ class WindowEventHandler
@subscribe $(window), 'blur', -> document.body.classList.add('is-blurred')
@subscribe $(window), 'beforeunload', =>
confirmed = atom.workspace?.confirmClose()
confirmed = atom.workspace?.confirmClose(windowCloseRequested: true)
atom.hide() if confirmed and not @reloadRequested and atom.getCurrentWindow().isWebViewFocused()
@reloadRequested = false
+2 -2
Ver Arquivo
@@ -599,8 +599,8 @@ class Workspace extends Model
saveAll: ->
@paneContainer.saveAll()
confirmClose: ->
@paneContainer.confirmClose()
confirmClose: (options) ->
@paneContainer.confirmClose(options)
# Save the active pane item.
#
+17
Ver Arquivo
@@ -13,6 +13,23 @@ window.onload = function() {
var fs = require('fs');
var path = require('path');
// Ensure ATOM_HOME is always set before anything else is required
if (!process.env.ATOM_HOME) {
var home;
if (process.platform === 'win32') {
home = process.env.USERPROFILE;
} else {
home = process.env.HOME;
}
var atomHome = path.join(home, '.atom');
try {
atomHome = fs.realpathSync(atomHome);
} catch (error) {
// Ignore since the path might just not exist yet.
}
process.env.ATOM_HOME = atomHome;
}
// Skip "?loadSettings=".
var rawLoadSettings = decodeURIComponent(location.search.substr(14));
var loadSettings;