mirror of
https://github.com/atom/atom.git
synced 2026-01-24 06:18:03 -05:00
Merge branch 'master' into dont-require-assert
This commit is contained in:
@@ -6,6 +6,6 @@
|
||||
"url": "https://github.com/atom/atom.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"atom-package-manager": "1.9.2"
|
||||
"atom-package-manager": "1.9.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ module.exports = (grunt) ->
|
||||
homeDir = process.env.USERPROFILE
|
||||
contentsDir = shellAppDir
|
||||
appDir = path.join(shellAppDir, 'resources', 'app')
|
||||
installDir ?= path.join(process.env.ProgramFiles, appName)
|
||||
installDir ?= path.join(process.env.LOCALAPPDATA, appName, 'app-dev')
|
||||
killCommand = 'taskkill /F /IM atom.exe'
|
||||
else if process.platform is 'darwin'
|
||||
homeDir = process.env.HOME
|
||||
|
||||
@@ -16,10 +16,22 @@ module.exports = (grunt) ->
|
||||
{description} = grunt.config.get('atom.metadata')
|
||||
|
||||
if process.platform is 'win32'
|
||||
runas ?= require 'runas'
|
||||
copyFolder = path.resolve 'script', 'copy-folder.cmd'
|
||||
if runas('cmd', ['/c', copyFolder, shellAppDir, installDir], admin: true) isnt 0
|
||||
grunt.log.error("Failed to copy #{shellAppDir} to #{installDir}")
|
||||
done = @async()
|
||||
fs.access(installDir, fs.W_OK, (err) ->
|
||||
adminRequired = true if err
|
||||
if adminRequired
|
||||
grunt.log.ok("User does not have write access to #{installDir}, elevating to admin")
|
||||
runas ?= require 'runas'
|
||||
copyFolder = path.resolve 'script', 'copy-folder.cmd'
|
||||
|
||||
if runas('cmd', ['/c', copyFolder, shellAppDir, installDir], admin: adminRequired) isnt 0
|
||||
grunt.log.error("Failed to copy #{shellAppDir} to #{installDir}")
|
||||
else
|
||||
grunt.log.ok("Installed into #{installDir}")
|
||||
|
||||
done()
|
||||
)
|
||||
|
||||
else if process.platform is 'darwin'
|
||||
rm installDir
|
||||
mkdir path.dirname(installDir)
|
||||
|
||||
@@ -34,7 +34,7 @@ git clone https://github.com/atom/atom/
|
||||
cd atom
|
||||
script/build
|
||||
```
|
||||
This will create the Atom application in the `out\Atom` folder as well as copy it to a folder named `Atom` within `Program Files`.
|
||||
This will create the Atom application in the `out\Atom` folder as well as copy it to a subfolder of your user profile (e.g. `c:\Users\Bob`) called `AppData\Local\atom\app-dev`.
|
||||
|
||||
### `script/build` Options
|
||||
* `--install-dir` - Creates the final built application in this directory. Example (trailing slash is optional):
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
"autocomplete-atom-api": "0.10.0",
|
||||
"autocomplete-css": "0.11.1",
|
||||
"autocomplete-html": "0.7.2",
|
||||
"autocomplete-plus": "2.29.2",
|
||||
"autocomplete-plus": "2.30.0",
|
||||
"autocomplete-snippets": "1.10.0",
|
||||
"autoflow": "0.27.0",
|
||||
"autosave": "0.23.1",
|
||||
@@ -141,7 +141,7 @@
|
||||
"language-ruby": "0.68.5",
|
||||
"language-ruby-on-rails": "0.25.0",
|
||||
"language-sass": "0.47.0",
|
||||
"language-shellscript": "0.21.1",
|
||||
"language-shellscript": "0.22.0",
|
||||
"language-source": "0.9.0",
|
||||
"language-sql": "0.21.0",
|
||||
"language-text": "0.7.1",
|
||||
|
||||
@@ -55,6 +55,14 @@ describe('GitRepositoryAsync', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('openedPath', () => {
|
||||
it('is the path passed to .open', () => {
|
||||
const workingDirPath = copyRepository()
|
||||
repo = GitRepositoryAsync.open(workingDirPath)
|
||||
expect(repo.openedPath).toBe(workingDirPath)
|
||||
})
|
||||
})
|
||||
|
||||
describe('.getRepo()', () => {
|
||||
beforeEach(() => {
|
||||
const workingDirectory = copySubmoduleRepository()
|
||||
|
||||
@@ -50,6 +50,10 @@ export default class GitRepositoryAsync {
|
||||
return this.repo._refreshingPromise
|
||||
}
|
||||
|
||||
get openedPath () {
|
||||
return this.repo.openedPath
|
||||
}
|
||||
|
||||
// Public: Destroy this {GitRepositoryAsync} object.
|
||||
//
|
||||
// This destroys any tasks and subscriptions and releases the underlying
|
||||
|
||||
@@ -81,7 +81,6 @@ class TextEditor extends Model
|
||||
state.clipboard = atomEnvironment.clipboard
|
||||
state.grammarRegistry = atomEnvironment.grammars
|
||||
state.assert = atomEnvironment.assert.bind(atomEnvironment)
|
||||
state.applicationDelegate = atomEnvironment.applicationDelegate
|
||||
editor = new this(state)
|
||||
if state.registered
|
||||
disposable = atomEnvironment.textEditors.add(editor)
|
||||
@@ -95,7 +94,7 @@ class TextEditor extends Model
|
||||
@softTabs, @firstVisibleScreenRow, @firstVisibleScreenColumn, initialLine, initialColumn, tabLength,
|
||||
softWrapped, @displayBuffer, @selectionsMarkerLayer, buffer, suppressCursorCreation,
|
||||
@mini, @placeholderText, lineNumberGutterVisible, largeFileMode, @config, @clipboard, @grammarRegistry,
|
||||
@assert, @applicationDelegate, grammar, showInvisibles, @autoHeight, @scrollPastEnd
|
||||
@assert, grammar, showInvisibles, @autoHeight, @scrollPastEnd
|
||||
} = params
|
||||
|
||||
throw new Error("Must pass a config parameter when constructing TextEditors") unless @config?
|
||||
@@ -510,7 +509,7 @@ class TextEditor extends Model
|
||||
@buffer, displayBuffer, selectionsMarkerLayer, @tabLength, softTabs,
|
||||
suppressCursorCreation: true, @config,
|
||||
@firstVisibleScreenRow, @firstVisibleScreenColumn,
|
||||
@clipboard, @grammarRegistry, @assert, @applicationDelegate
|
||||
@clipboard, @grammarRegistry, @assert
|
||||
})
|
||||
newEditor
|
||||
|
||||
|
||||
@@ -573,8 +573,7 @@ class Workspace extends Model
|
||||
# Returns a {TextEditor}.
|
||||
buildTextEditor: (params) ->
|
||||
params = _.extend({
|
||||
@config, @clipboard, @grammarRegistry,
|
||||
@assert, @applicationDelegate
|
||||
@config, @clipboard, @grammarRegistry, @assert
|
||||
}, params)
|
||||
new TextEditor(params)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user