Skip to content
This repository has been archived by the owner on Apr 4, 2019. It is now read-only.

Commit

Permalink
Move config to a json file inside .tilemill directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
wrynearson committed Dec 22, 2011
1 parent e7c126d commit d4737d6
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion _posts/0100-01-01-CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ releases:
- Centerpoint is included in exports if it is valid.
- More resonable default zoom settings for new projects.
- Added option to update to development builds.
- Moved preferences to `~/.tilemill.json`.
- Moved preferences to `~/.tilemill/config.json`.
- Changed default server port to 20009.
- Better logging/error reporting from export command.

Expand Down
2 changes: 1 addition & 1 deletion _posts/docs/0201-01-01-upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ permalink: /docs/upgrade

### Location of preferences

TileMill settings are now located at `~/.tilemill.json`. If you are running TileMill as an Ubuntu service, this file will be located at `/usr/share/mapbox/.tilemill.json`. You must manually copy any customized settings to this location before starting TileMill.
TileMill settings are now located at `~/.tilemill/config.json`. If you are running TileMill as an Ubuntu service, this file will be located at `/usr/share/mapbox/.tilemill/config.json`. You must manually copy any customized settings to this location before starting TileMill.

### Port change

Expand Down
4 changes: 2 additions & 2 deletions _posts/docs/manual/0202-02-01-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ TileMill for Mac OS X is meant to be run as a desktop-style application.
- **Files** used by TileMill are in your user account's `Documents/MapBox` folder
- **Logs** are viewable by choosing `Console` from the app's `Window` menu
- **Preferences** are available from the application's main screen
- **Advanced preferences** can be changed by editing `~/.tilemill.json`
- **Advanced preferences** can be changed by editing `~/.tilemill/config.json`

## Ubuntu

Expand All @@ -26,7 +26,7 @@ TileMill for Mac OS X is meant to be run as a desktop-style application.
- **Files** used by TileMill are in your user account's `Documents/MapBox` folder
- **Logs** are written to `~/.tilemill.log`
- **Preferences** are available from the application's main screen
- **Advanced preferences** can be changed by editing `~/.tilemill.json`
- **Advanced preferences** can be changed by editing `~/.tilemill/config.json`

## Advanced preferences

Expand Down
6 changes: 6 additions & 0 deletions commands/start.bones
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ commands['start'].prototype.bootstrap = function(plugin, callback) {
var settings = Bones.plugin.config;
settings.files = path.resolve(settings.files);

var configDir = path.join(process.env.HOME, '.tilemill');
if (!path.existsSync(configDir)) {
console.warn('Creating configuration dir %s', configDir);
fsutil.mkdirpSync(configDir, 0755);
}

if (!path.existsSync(settings.files)) {
console.warn('Creating files dir %s', settings.files);
fsutil.mkdirpSync(settings.files, 0755);
Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ process.argv[0] = 'node';
// @TODO find a more elegant way to set a default for this value
// upstream in bones.
var path = require('path');
var config = path.join(process.env.HOME, '.tilemill.json');
var config = path.join(process.env.HOME, '.tilemill/config.json');
if (path.existsSync(config)) {
var argv = require('bones/node_modules/optimist').argv;
argv.config = argv.config || config;
Expand Down
2 changes: 1 addition & 1 deletion models/Config.server.bones
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var fs = require('fs');
var path = require('path');
var Step = require('step');
var paths = {
user: path.join(process.env.HOME, '.tilemill.json'),
user: path.join(process.env.HOME, '.tilemill/config.json'),
vendor: path.resolve(__dirname + '/../lib/config.defaults.json')
};

Expand Down

0 comments on commit d4737d6

Please sign in to comment.