Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #1571 from mapbox/relative-path

Use relative paths if file in project dir
  • Loading branch information...
commit 3cdd57186db3e04cd90911d405c960b092d16237 2 parents 0c1c48a + 8ba95b5
@springmeyer springmeyer authored
Showing with 8 additions and 1 deletion.
  1. +1 −1  models/Library.server.bones
  2. +7 −0 models/Project.server.bones
View
2  models/Library.server.bones
@@ -49,7 +49,7 @@ models.Library.prototype.sync = function(method, model, success, error) {
.replace(/^([a-zA-Z]:\\|\/)/, sep);
// Resolve paths relative to project directory.
- if (!location[0] === sep) {
+ if (location[0] !== sep) {
location = path.join(config.files, 'project', model.get('project'), location);
}
View
7 models/Project.server.bones
@@ -314,6 +314,13 @@ function saveProject(model, callback) {
return s.id || s;
});
+ data.Layer = _(data.Layer).map(function(l) {
+ if (l.Datasource.file && !l.Datasource.file.indexOf(modelPath)) {
+ l.Datasource.file = path.relative(modelPath, l.Datasource.file);
+ }
+ return l;
+ });
+
_(data).chain()
.keys()
.filter(function(k) { return schema[k] && !schema[k].ignore })
Please sign in to comment.
Something went wrong with that request. Please try again.