From 58e1953e43e206788706087a813396915f470316 Mon Sep 17 00:00:00 2001 From: Damien Guard Date: Fri, 22 Apr 2016 12:07:19 -0700 Subject: [PATCH 1/4] Win32 build now installs to localappdata. Admin elevation now smart. --- build/Gruntfile.coffee | 2 +- build/tasks/install-task.coffee | 20 ++++++++++++++++---- docs/build-instructions/windows.md | 2 +- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/build/Gruntfile.coffee b/build/Gruntfile.coffee index 73279779c..16e0ed5d6 100644 --- a/build/Gruntfile.coffee +++ b/build/Gruntfile.coffee @@ -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 diff --git a/build/tasks/install-task.coffee b/build/tasks/install-task.coffee index 2d9054385..19fd3d383 100644 --- a/build/tasks/install-task.coffee +++ b/build/tasks/install-task.coffee @@ -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) diff --git a/docs/build-instructions/windows.md b/docs/build-instructions/windows.md index 3ec28f139..d0e101ba0 100644 --- a/docs/build-instructions/windows.md +++ b/docs/build-instructions/windows.md @@ -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): From 5db3280bf04dce58684ecaec26ee044f05de9780 Mon Sep 17 00:00:00 2001 From: joshaber Date: Wed, 27 Apr 2016 11:59:05 -0400 Subject: [PATCH 2/4] Provide openedPath For backward compatibility with GitRepoAsync before moving to ohnogit. --- src/git-repository-async.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/git-repository-async.js b/src/git-repository-async.js index b691994bc..66b73ba77 100644 --- a/src/git-repository-async.js +++ b/src/git-repository-async.js @@ -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 From 30d6353fd8e46af780bd6b47da585b62b10eddfa Mon Sep 17 00:00:00 2001 From: joshaber Date: Wed, 27 Apr 2016 12:03:29 -0400 Subject: [PATCH 3/4] Spec for openedPath. --- spec/git-repository-async-spec.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spec/git-repository-async-spec.js b/spec/git-repository-async-spec.js index 1fbe537d5..fcb528819 100644 --- a/spec/git-repository-async-spec.js +++ b/spec/git-repository-async-spec.js @@ -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() From b4733732dcf45546e976160508e4100339f7f7f8 Mon Sep 17 00:00:00 2001 From: Lee Dohm Date: Wed, 27 Apr 2016 10:35:39 -0700 Subject: [PATCH 4/4] :arrow_up: autocomplete-plus@2.30.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 51d1f06e8..1802e8bd1 100644 --- a/package.json +++ b/package.json @@ -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",