From fcfae5d4908b5cbc4277f02a68c6c87075d8497b Mon Sep 17 00:00:00 2001
From: Evan Morikawa
Date: Fri, 13 Jan 2017 18:54:37 -0800
Subject: [PATCH] Fix references for ~/.nylas to ~/.nylas-mail
Summary: Fix references to nylas-mail
Test Plan: manual
Reviewers: jackie, juan
Reviewed By: juan
Differential Revision: https://phab.nylas.com/D3674
---
README.md | 4 +-
build/resources/linux/nylas.sh | 4 +-
docs/PackageOverview.md | 2 +-
dot-nylas/README.md | 2 +-
internal_packages/composer-markdown/README.md | 2 +-
.../composer-templates/README.md | 4 +-
.../lib/preferences-templates.jsx | 2 +-
.../spec/template-store-spec.es6 | 2 +-
.../github-contact-card/README.md | 2 +-
.../message-view-on-github/README.md | 2 +-
.../phishing-detection/README.md | 2 +-
.../plugins/lib/tab-installed.jsx | 6 +--
internal_packages/ui-darkside/README.md | 2 +-
spec/stores/file-download-store-spec.coffee | 38 +++++++++----------
src/K2 | 2 +-
src/browser/application.es6 | 6 +--
src/browser/main.js | 2 +-
src/browser/nylas-protocol-handler.es6 | 8 ++--
src/package-manager.coffee | 2 +-
src/package.coffee | 2 +-
20 files changed, 48 insertions(+), 48 deletions(-)
diff --git a/README.md b/README.md
index 4e90e117c..784fa1e42 100644
--- a/README.md
+++ b/README.md
@@ -70,7 +70,7 @@ The Nylas Mail user interface is styled using CSS, which means it's easy to modi
1. Download and unzip the repo
2. In Nylas Mail, select `Developer > Install a Package Manually... `
-3. Navigate to where you downloaded the theme and select the root folder. The theme is copied into the `~/.nylas` folder for your convinence
+3. Navigate to where you downloaded the theme and select the root folder. The theme is copied into the `~/.nylas-mail` folder for your convinence
5. Select `Change Theme...` from the top level menu, and you'll see the newly installed theme. That's it!
@@ -109,7 +109,7 @@ Note these are not tested or officially supported by Nylas, but we still think t
- [Wunderlist](https://github.com/miguelrs/n1-wunderlist)
- [Participants Display](https://github.com/kbruccoleri/nylas-participants-display)
-When you install packages, they're moved to ~/.nylas/packages, and N1 runs apm install on the command line to fetch dependencies listed in the package's package.json
+When you install packages, they're moved to ~/.nylas-mail/packages, and N1 runs apm install on the command line to fetch dependencies listed in the package's package.json
# Configuration
diff --git a/build/resources/linux/nylas.sh b/build/resources/linux/nylas.sh
index 59c77fd9b..6761458a9 100755
--- a/build/resources/linux/nylas.sh
+++ b/build/resources/linux/nylas.sh
@@ -79,8 +79,8 @@ elif [ $OS == 'Linux' ]; then
SCRIPT=$(readlink -f "$0")
USR_DIRECTORY=$(readlink -f $(dirname $SCRIPT)/..)
- NYLAS_PATH="$USR_DIRECTORY/share/nylas/nylas"
- NYLAS_HOME="${NYLAS_HOME:-$HOME/.nylas}"
+ NYLAS_PATH="$USR_DIRECTORY/share/nylas/nylas-mail"
+ NYLAS_HOME="${NYLAS_HOME:-$HOME/.nylas-mail}"
mkdir -p "$NYLAS_HOME"
: ${TMPDIR:=/tmp}
diff --git a/docs/PackageOverview.md b/docs/PackageOverview.md
index 8675b6577..32e92e3b5 100644
--- a/docs/PackageOverview.md
+++ b/docs/PackageOverview.md
@@ -104,6 +104,6 @@ a.play()
### Installing a Package
-N1 ships with many packages already bundled with the application. When the application launches, it looks for additional packages in `~/.nylas/dev/packages`. Each package you create belongs in its own directory inside this folder.
+N1 ships with many packages already bundled with the application. When the application launches, it looks for additional packages in `~/.nylas-mail/dev/packages`. Each package you create belongs in its own directory inside this folder.
In the future, it will be possible to install packages directly from within the client.
diff --git a/dot-nylas/README.md b/dot-nylas/README.md
index 1d7940509..d2174a44a 100644
--- a/dot-nylas/README.md
+++ b/dot-nylas/README.md
@@ -1,4 +1,4 @@
# Default Config
These are the default Nylas configs. This folder on setup is copied to
-`~/.nylas` on unix machines.
+`~/.nylas-mail` on unix machines.
diff --git a/internal_packages/composer-markdown/README.md b/internal_packages/composer-markdown/README.md
index faab9413a..55468c6d5 100644
--- a/internal_packages/composer-markdown/README.md
+++ b/internal_packages/composer-markdown/README.md
@@ -16,7 +16,7 @@ A plugin for N1 that allows you to compose emails using markdown.
3. From the menu, select `Developer > Install a Package Manually...`
From the dialog, choose the directory of this plugin to install it!
- > When you install packages, they're moved to `~/.nylas/packages`,
+ > When you install packages, they're moved to `~/.nylas-mail/packages`,
> and N1 runs `apm install` on the command line to fetch dependencies
> listed in the package's `package.json`
diff --git a/internal_packages/composer-templates/README.md b/internal_packages/composer-templates/README.md
index 4c73990e2..6f1178fec 100644
--- a/internal_packages/composer-templates/README.md
+++ b/internal_packages/composer-templates/README.md
@@ -1,7 +1,7 @@
# Composer Templates
Create templates you can use to pre-fill the N1 composer - never type the same
-email again! Templates live in the ~/.nylas/templates directory on your computer.
+email again! Templates live in the ~/.nylas-mail/templates directory on your computer.
Each template is an HTML file - the name of the
file is the name of the template, and it's contents are the default message body.
@@ -24,6 +24,6 @@ experience.
The dialog will default to this examples directory. Just choose the
package to install it!
- > When you install packages, they're moved to `~/.nylas/packages`,
+ > When you install packages, they're moved to `~/.nylas-mail/packages`,
> and N1 runs `apm install` on the command line to fetch dependencies
> listed in the package's `package.json`
diff --git a/internal_packages/composer-templates/lib/preferences-templates.jsx b/internal_packages/composer-templates/lib/preferences-templates.jsx
index 238a510ab..0b8101396 100644
--- a/internal_packages/composer-templates/lib/preferences-templates.jsx
+++ b/internal_packages/composer-templates/lib/preferences-templates.jsx
@@ -317,7 +317,7 @@ class PreferencesTemplates extends React.Component {
sent.
- Reply templates are saved as HTML files in the ~/.nylas/templates directory on your computer. In raw HTML, variables are defined as HTML <code> tags with class "var empty".
+ Reply templates are saved as HTML files in the ~/.nylas-mail/templates directory on your computer. In raw HTML, variables are defined as HTML <code> tags with class "var empty".
diff --git a/internal_packages/composer-templates/spec/template-store-spec.es6 b/internal_packages/composer-templates/spec/template-store-spec.es6
index 133f37522..65a7ffba3 100644
--- a/internal_packages/composer-templates/spec/template-store-spec.es6
+++ b/internal_packages/composer-templates/spec/template-store-spec.es6
@@ -5,7 +5,7 @@ import TemplateStore from '../lib/template-store';
const { shell } = remote;
-const stubTemplatesDir = '~/.nylas/templates';
+const stubTemplatesDir = '~/.nylas-mail/templates';
const stubTemplateFiles = {
'template1.html': 'bla1
',
diff --git a/internal_packages/github-contact-card/README.md b/internal_packages/github-contact-card/README.md
index defea44fc..7b40f188e 100644
--- a/internal_packages/github-contact-card/README.md
+++ b/internal_packages/github-contact-card/README.md
@@ -17,6 +17,6 @@ external sources in the sidebar. If you want to see some more advanced plugins,
The dialog will default to this examples directory. Just choose the
package to install it!
- > When you install packages, they're moved to `~/.nylas/packages`,
+ > When you install packages, they're moved to `~/.nylas-mail/packages`,
> and N1 runs `apm install` on the command line to fetch dependencies
> listed in the package's `package.json`
diff --git a/internal_packages/message-view-on-github/README.md b/internal_packages/message-view-on-github/README.md
index 609f7f93f..9bd21cc0a 100644
--- a/internal_packages/message-view-on-github/README.md
+++ b/internal_packages/message-view-on-github/README.md
@@ -16,6 +16,6 @@ actions.
The dialog will default to this examples directory. Just choose the
package to install it!
- > When you install packages, they're moved to `~/.nylas/packages`,
+ > When you install packages, they're moved to `~/.nylas-mail/packages`,
> and N1 runs `apm install` on the command line to fetch dependencies
> listed in the package's `package.json`
diff --git a/internal_packages/phishing-detection/README.md b/internal_packages/phishing-detection/README.md
index 383b71c1b..1082c814a 100644
--- a/internal_packages/phishing-detection/README.md
+++ b/internal_packages/phishing-detection/README.md
@@ -13,7 +13,7 @@ a message's originating address is different from its return address. The warnin
The dialog will default to this examples directory. Just choose the
package to install it!
- > When you install packages, they're moved to `~/.nylas/packages`,
+ > When you install packages, they're moved to `~/.nylas-mail/packages`,
> and N1 runs `apm install` on the command line to fetch dependencies
> listed in the package's `package.json`
diff --git a/internal_packages/plugins/lib/tab-installed.jsx b/internal_packages/plugins/lib/tab-installed.jsx
index 4fef77969..00d41fd4a 100644
--- a/internal_packages/plugins/lib/tab-installed.jsx
+++ b/internal_packages/plugins/lib/tab-installed.jsx
@@ -61,13 +61,13 @@ class TabInstalled extends React.Component {
}
let devPackages = []
- let devEmpty = (Run with debug flags enabled to load ~/.nylas/dev/packages.);
+ let devEmpty = (Run with debug flags enabled to load ~/.nylas-mail/dev/packages.);
let devCTA = (Enable Debug Flags
);
if (NylasEnv.inDevMode()) {
devPackages = this.state.packages.dev || [];
devEmpty = (
- {`You don't have any packages installed in ~/.nylas/dev/packages. `}
+ {`You don't have any packages installed in ~/.nylas-mail/dev/packages. `}
These plugins are only loaded when you run the app with debug flags
enabled (via the Developer menu).
Learn more about building
plugins with our docs.
@@ -92,7 +92,7 @@ class TabInstalled extends React.Component {
packages={this.state.packages.user}
showVersions
title="Installed plugins"
- emptyText={searchEmpty || {`You don't have any plugins installed in ~/.nylas/packages.`}}
+ emptyText={searchEmpty || {`You don't have any plugins installed in ~/.nylas-mail/packages.`}}
/>
**Open the theme directory**
-> If you're on a Mac, you can find the theme files at `~/.nylas/packages`. To get there quickly, use the key command Cmd + Shift + G and enter `~/.nylas/packages`.
+> If you're on a Mac, you can find the theme files at `~/.nylas-mail/packages`. To get there quickly, use the key command Cmd + Shift + G and enter `~/.nylas-mail/packages`.
> **Change package.json**
> In order to avoid conflicts between your custom theme and the pre-installed version, change `name` and `displayName` in `package.json` to:
diff --git a/spec/stores/file-download-store-spec.coffee b/spec/stores/file-download-store-spec.coffee
index 7026bfdf8..0dbd1335f 100644
--- a/spec/stores/file-download-store-spec.coffee
+++ b/spec/stores/file-download-store-spec.coffee
@@ -65,32 +65,32 @@ xdescribe 'FileDownloadStoreSpecs', ->
percent : 0,
filename : '123.png',
filesize : 100,
- targetPath : '/Users/testuser/.nylas/downloads/id/123.png'
+ targetPath : '/Users/testuser/.nylas-mail/downloads/id/123.png'
})
FileDownloadStore._downloads = {}
- FileDownloadStore._downloadDirectory = "/Users/testuser/.nylas/downloads"
+ FileDownloadStore._downloadDirectory = "/Users/testuser/.nylas-mail/downloads"
spyOn(FileDownloadStore, '_generatePreview').andReturn(Promise.resolve())
describe "pathForFile", ->
it "should return path within the download directory with the file id and displayName", ->
f = new File(filename: '123.png', contentType: 'image/png', id: 'id')
spyOn(f, 'displayName').andCallThrough()
- expect(FileDownloadStore.pathForFile(f)).toBe("/Users/testuser/.nylas/downloads/id/123.png")
+ expect(FileDownloadStore.pathForFile(f)).toBe("/Users/testuser/.nylas-mail/downloads/id/123.png")
expect(f.displayName).toHaveBeenCalled()
it "should return unique paths for identical filenames with different IDs", ->
f1 = new File(filename: '123.png', contentType: 'image/png', id: 'id1')
f2 = new File(filename: '123.png', contentType: 'image/png', id: 'id2')
- expect(FileDownloadStore.pathForFile(f1)).toBe("/Users/testuser/.nylas/downloads/id1/123.png")
- expect(FileDownloadStore.pathForFile(f2)).toBe("/Users/testuser/.nylas/downloads/id2/123.png")
+ expect(FileDownloadStore.pathForFile(f1)).toBe("/Users/testuser/.nylas-mail/downloads/id1/123.png")
+ expect(FileDownloadStore.pathForFile(f2)).toBe("/Users/testuser/.nylas-mail/downloads/id2/123.png")
it "should escape the displayName if it contains path separator characters", ->
f1 = new File(filename: "static#{path.sep}b#{path.sep}a.jpg", contentType: 'image/png', id: 'id1')
- expect(FileDownloadStore.pathForFile(f1)).toBe("/Users/testuser/.nylas/downloads/id1/static-b-a.jpg")
+ expect(FileDownloadStore.pathForFile(f1)).toBe("/Users/testuser/.nylas-mail/downloads/id1/static-b-a.jpg")
f1 = new File(filename: "my:file ? Windows /hates/ me :->.jpg", contentType: 'image/png', id: 'id1')
- expect(FileDownloadStore.pathForFile(f1)).toBe("/Users/testuser/.nylas/downloads/id1/my-file - Windows -hates- me ---.jpg")
+ expect(FileDownloadStore.pathForFile(f1)).toBe("/Users/testuser/.nylas-mail/downloads/id1/my-file - Windows -hates- me ---.jpg")
describe "_checkForDownloadedFile", ->
it "should return true if the file exists at the path and is the right size", ->
@@ -173,7 +173,7 @@ xdescribe 'FileDownloadStoreSpecs', ->
percent : 0,
filename : '123.png',
filesize : 100,
- targetPath : '/Users/testuser/.nylas/downloads/id/123.png'
+ targetPath : '/Users/testuser/.nylas-mail/downloads/id/123.png'
})
describe "when the downloaded file does not exist", ->
@@ -189,7 +189,7 @@ xdescribe 'FileDownloadStoreSpecs', ->
percent : 0,
filename : '123.png',
filesize : 100,
- targetPath : '/Users/testuser/.nylas/downloads/id/123.png'
+ targetPath : '/Users/testuser/.nylas-mail/downloads/id/123.png'
})
it "should call download.run", ->
@@ -208,7 +208,7 @@ xdescribe 'FileDownloadStoreSpecs', ->
percent : 0,
filename : '123.png',
filesize : 100,
- targetPath : '/Users/testuser/.nylas/downloads/id/123.png'
+ targetPath : '/Users/testuser/.nylas-mail/downloads/id/123.png'
})
describe "_fetch", ->
@@ -227,7 +227,7 @@ xdescribe 'FileDownloadStoreSpecs', ->
describe "_fetchAndOpen", ->
it "should open the file once it's been downloaded", ->
- @savePath = "/Users/imaginary/.nylas/Downloads/a.png"
+ @savePath = "/Users/imaginary/.nylas-mail/Downloads/a.png"
download = {targetPath: @savePath}
downloadResolve = null
@@ -251,7 +251,7 @@ xdescribe 'FileDownloadStoreSpecs', ->
describe "_fetchAndSave", ->
beforeEach ->
- @userSelectedPath = "/Users/imaginary/.nylas/Downloads/b.png"
+ @userSelectedPath = "/Users/imaginary/.nylas-mail/Downloads/b.png"
spyOn(NylasEnv, 'showSaveDialog').andCallFake (options, callback) => callback(@userSelectedPath)
it "should open a save dialog and prompt the user to choose a download path", ->
@@ -295,7 +295,7 @@ xdescribe 'FileDownloadStoreSpecs', ->
spyOn(FileDownloadStore, '_saveDownload').andCallFake =>
Promise.resolve(@testfile)
NylasEnv.savedState.lastDownloadDirectory = null
- @userSelectedPath = "/Users/imaginary/.nylas/Another Random Folder/file.jpg"
+ @userSelectedPath = "/Users/imaginary/.nylas-mail/Another Random Folder/file.jpg"
FileDownloadStore._fetchAndSave(@testfile)
advanceClock(1)
expect(shell.showItemInFolder).toHaveBeenCalledWith(@userSelectedPath)
@@ -303,8 +303,8 @@ xdescribe 'FileDownloadStoreSpecs', ->
it "should not show the file in the folder if the download path is the previous download path", ->
spyOn(FileDownloadStore, '_saveDownload').andCallFake =>
Promise.resolve(@testfile)
- @userSelectedPath = "/Users/imaginary/.nylas/Another Random Folder/123.png"
- NylasEnv.savedState.lastDownloadDirectory = "/Users/imaginary/.nylas/Another Random Folder"
+ @userSelectedPath = "/Users/imaginary/.nylas-mail/Another Random Folder/123.png"
+ NylasEnv.savedState.lastDownloadDirectory = "/Users/imaginary/.nylas-mail/Another Random Folder"
FileDownloadStore._fetchAndSave(@testfile)
advanceClock(1)
expect(shell.showItemInFolder).not.toHaveBeenCalled()
@@ -313,20 +313,20 @@ xdescribe 'FileDownloadStoreSpecs', ->
spyOn(FileDownloadStore, '_saveDownload').andCallFake =>
Promise.resolve(@testfile)
NylasEnv.savedState.lastDownloadDirectory = null
- @userSelectedPath = "/Users/imaginary/.nylas/Another Random Folder/file.jpg"
+ @userSelectedPath = "/Users/imaginary/.nylas-mail/Another Random Folder/file.jpg"
FileDownloadStore._fetchAndSave(@testfile)
advanceClock(1)
- expect(NylasEnv.savedState.lastDownloadDirectory).toEqual('/Users/imaginary/.nylas/Another Random Folder')
+ expect(NylasEnv.savedState.lastDownloadDirectory).toEqual('/Users/imaginary/.nylas-mail/Another Random Folder')
describe "file extensions", ->
it "should allow the user to save the file with a different extension", ->
- @userSelectedPath = "/Users/imaginary/.nylas/Downloads/b-changed.tiff"
+ @userSelectedPath = "/Users/imaginary/.nylas-mail/Downloads/b-changed.tiff"
FileDownloadStore._fetchAndSave(@testfile)
advanceClock(1)
expect(fs.createWriteStream).toHaveBeenCalledWith(@userSelectedPath)
it "should restore the extension if the user removed it entirely, because it's usually an accident", ->
- @userSelectedPath = "/Users/imaginary/.nylas/Downloads/b-changed"
+ @userSelectedPath = "/Users/imaginary/.nylas-mail/Downloads/b-changed"
FileDownloadStore._fetchAndSave(@testfile)
advanceClock(1)
expect(fs.createWriteStream).toHaveBeenCalledWith("#{@userSelectedPath}.png")
diff --git a/src/K2 b/src/K2
index a865fabe4..da61c6533 160000
--- a/src/K2
+++ b/src/K2
@@ -1 +1 @@
-Subproject commit a865fabe488eb853f347e3062c9ea9459df12d67
+Subproject commit da61c6533410534caa6ec7a2a401905795e6b0e0
diff --git a/src/browser/application.es6 b/src/browser/application.es6
index 2ba8fe445..1715f5cca 100644
--- a/src/browser/application.es6
+++ b/src/browser/application.es6
@@ -746,8 +746,8 @@ export default class Application extends EventEmitter {
// window
// :resourcePath - The path to include specs from.
// :specPath - The directory to load specs from.
- // :safeMode - A Boolean that, if true, won't run specs from ~/.nylas/packages
- // and ~/.nylas/dev/packages, defaults to false.
+ // :safeMode - A Boolean that, if true, won't run specs from ~/.nylas-mail/packages
+ // and ~/.nylas-mail/dev/packages, defaults to false.
runSpecs(specWindowOptionsArg) {
const specWindowOptions = specWindowOptionsArg;
let {resourcePath} = specWindowOptions;
@@ -762,7 +762,7 @@ export default class Application extends EventEmitter {
bootstrapScript = require.resolve(path.resolve(__dirname, '..', '..', 'spec', 'n1-spec-runner', 'spec-bootstrap'));
}
- // Important: Use .nylas-spec instead of .nylas to avoid overwriting the
+ // Important: Use .nylas-spec instead of .nylas-mail to avoid overwriting the
// user's real email config!
const configDirPath = path.join(app.getPath('home'), '.nylas-spec');
diff --git a/src/browser/main.js b/src/browser/main.js
index bdef94e46..ad9db338e 100644
--- a/src/browser/main.js
+++ b/src/browser/main.js
@@ -53,7 +53,7 @@ const declareOptions = (argv) => {
options.usage("Nylas Mail v" + (app.getVersion()) + "\n\nUsage: n1 [options]\n\nRun N1: The open source extensible email client\n\n`n1 --dev` to start the client in dev mode.\n\n`n1 --test` to run unit tests.");
options.alias('d', 'dev').boolean('d').describe('d', 'Run in development mode.');
options.alias('t', 'test').boolean('t').describe('t', 'Run the specified specs and exit with error code on failures.');
- options.boolean('safe').describe('safe', 'Do not load packages from ~/.nylas/packages or ~/.nylas/dev/packages.');
+ options.boolean('safe').describe('safe', 'Do not load packages from ~/.nylas-mail/packages or ~/.nylas/dev/packages.');
options.alias('h', 'help').boolean('h').describe('h', 'Print this usage message.');
options.alias('l', 'log-file').string('l').describe('l', 'Log all test output to file.');
options.alias('c', 'config-dir-path').string('c').describe('c', 'Override the path to the N1 configuration directory');
diff --git a/src/browser/nylas-protocol-handler.es6 b/src/browser/nylas-protocol-handler.es6
index 48ba3507b..6aa87f548 100644
--- a/src/browser/nylas-protocol-handler.es6
+++ b/src/browser/nylas-protocol-handler.es6
@@ -8,15 +8,15 @@ import path from 'path';
// custom resource loader for 'nylas://' URLs.
//
// The following directories are searched in order:
-// * ~/.nylas/assets
-// * ~/.nylas/dev/packages (unless in safe mode)
-// * ~/.nylas/packages
+// * ~/.nylas-mail/assets
+// * ~/.nylas-mail/dev/packages (unless in safe mode)
+// * ~/.nylas-mail/packages
// * RESOURCE_PATH/node_modules
//
export default class NylasProtocolHandler {
constructor(resourcePath, safeMode) {
this.loadPaths = [];
- this.dotNylasDirectory = path.join(app.getPath('home'), '.nylas');
+ this.dotNylasDirectory = path.join(app.getPath('home'), '.nylas-mail');
if (!safeMode) {
this.loadPaths.push(path.join(this.dotNylasDirectory, 'dev', 'packages'));
diff --git a/src/package-manager.coffee b/src/package-manager.coffee
index 21f68ca3f..d965e4797 100644
--- a/src/package-manager.coffee
+++ b/src/package-manager.coffee
@@ -406,7 +406,7 @@ class PackageManager
fs.exists packageTargetDir, (packageAlreadyExists) =>
if packageAlreadyExists
- return callback(new Error("A package named '#{packageName}' is already installed in ~/.nylas/packages."), null)
+ return callback(new Error("A package named '#{packageName}' is already installed in ~/.nylas-mail/packages."), null)
fs.copySync(packageSourceDir, packageTargetDir)
diff --git a/src/package.coffee b/src/package.coffee
index 72dc13fed..99642b375 100644
--- a/src/package.coffee
+++ b/src/package.coffee
@@ -381,7 +381,7 @@ class Package
# Public: Is this package compatible with this version of N1?
#
# Incompatible packages cannot be activated. This will include packages
- # installed to ~/.nylas/packages that were built against node 0.11.10 but
+ # installed to ~/.nylas-mail/packages that were built against node 0.11.10 but
# now need to be upgrade to node 0.11.13.
#
# Returns a {Boolean}, true if compatible, false if incompatible.