{"action":"created","issue":{"url":"https://api.github.com/repos/assemble/assemble/issues/691","labels_url":"https://api.github.com/repos/assemble/assemble/issues/691/labels{/name}","comments_url":"https://api.github.com/repos/assemble/assemble/issues/691/comments","events_url":"https://api.github.com/repos/assemble/assemble/issues/691/events","html_url":"https://github.com/assemble/assemble/issues/691","id":69789430,"number":691,"title":"assemble.data fails when cwd contains dots (.)","user":{"login":"fterrier","id":767302,"avatar_url":"https://avatars.githubusercontent.com/u/767302?v=3","gravatar_id":"","url":"https://api.github.com/users/fterrier","html_url":"https://github.com/fterrier","followers_url":"https://api.github.com/users/fterrier/followers","following_url":"https://api.github.com/users/fterrier/following{/other_user}","gists_url":"https://api.github.com/users/fterrier/gists{/gist_id}","starred_url":"https://api.github.com/users/fterrier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fterrier/subscriptions","organizations_url":"https://api.github.com/users/fterrier/orgs","repos_url":"https://api.github.com/users/fterrier/repos","events_url":"https://api.github.com/users/fterrier/events{/privacy}","received_events_url":"https://api.github.com/users/fterrier/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-21T09:04:09Z","updated_at":"2016-01-15T03:31:39Z","closed_at":"2016-01-15T03:31:39Z","body":"We had an issue with assemble.data that caused this error to occur :\r\n```\r\nSyntaxError: Unexpected token o\r\n    at Object.parse (native)\r\n    at readData (/Users/username/my.super.project/node_modules/assemble/node_modules/template/node_modules/config-cache/node_modules/plasma/index.js:235:19)\r\n    at read (/Users/username/my.super.project/node_modules/assemble/node_modules/template/node_modules/config-cache/node_modules/plasma/index.js:215:10)\r\n    at Plasma.mergeFile (/Users/username/my.super.project/node_modules/assemble/node_modules/template/node_modules/config-cache/node_modules/plasma/index.js:140:13)\r\n    at Plasma.glob (/Users/username/my.super.project/node_modules/assemble/node_modules/template/node_modules/config-cache/node_modules/plasma/index.js:174:29)\r\n    at Plasma.mergeArray (/Users/username/my.super.project/node_modules/assemble/node_modules/template/node_modules/config-cache/node_modules/plasma/index.js:115:18)\r\n    at Plasma.load (/Users/username/my.super.project/node_modules/assemble/node_modules/template/node_modules/config-cache/node_modules/plasma/index.js:82:17)\r\n    at Assemble.Cache.plasma (/Users/username/my.super.project/node_modules/assemble/node_modules/template/node_modules/config-cache/index.js:515:28)\r\n    at Assemble.Cache.data (/Users/username/my.super.project/node_modules/assemble/node_modules/template/node_modules/config-cache/index.js:566:25)\r\n    at Object.<anonymous> (/Users/username/my.super.project/gulptasks/assemble.js:16:10)\r\n```\r\n\r\nWe tracked down the problem and noticed it is because of our working directory name containing several dots.\r\n\r\nTo reproduce:\r\n1. create a project folder with several dots in the name\r\n2. create a `data` folder in it that contains json files\r\n3. create a gulptask that uses assemble, for example:\r\n```\r\nvar gulp = require('gulp');\r\nvar assemble = require('assemble');\r\nvar gulpAssemble = require('gulp-assemble');\r\n\r\nassemble.data(['/data/*.json']);\r\ngulp.task('assemble-single-components', function() {\r\n    return gulp.src([**/*.hbs'])\r\n    .pipe(gulpAssemble(assemble))\r\n    .pipe(gulp.dest(config.paths.dev));\r\n});\r\n```\r\n\r\nWe tracked down the issue already to this line in the plasma dependency in file `index.js` on line 137:\r\n```\r\nfp = relative(path.resolve(opts.cwd, fp));\r\n```\r\n\r\nThis causes the `fp` variable to also contains the project name, which is then wrong, relative to the project directory.\r\n\r\nI created an issue on https://github.com/jonschlinkert/relative project:\r\nhttps://github.com/jonschlinkert/relative/issues/5"},"comment":{"url":"https://api.github.com/repos/assemble/assemble/issues/comments/171863738","html_url":"https://github.com/assemble/assemble/issues/691#issuecomment-171863738","issue_url":"https://api.github.com/repos/assemble/assemble/issues/691","id":171863738,"user":{"login":"jonschlinkert","id":383994,"avatar_url":"https://avatars.githubusercontent.com/u/383994?v=3","gravatar_id":"","url":"https://api.github.com/users/jonschlinkert","html_url":"https://github.com/jonschlinkert","followers_url":"https://api.github.com/users/jonschlinkert/followers","following_url":"https://api.github.com/users/jonschlinkert/following{/other_user}","gists_url":"https://api.github.com/users/jonschlinkert/gists{/gist_id}","starred_url":"https://api.github.com/users/jonschlinkert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonschlinkert/subscriptions","organizations_url":"https://api.github.com/users/jonschlinkert/orgs","repos_url":"https://api.github.com/users/jonschlinkert/repos","events_url":"https://api.github.com/users/jonschlinkert/events{/privacy}","received_events_url":"https://api.github.com/users/jonschlinkert/received_events","type":"User","site_admin":false},"created_at":"2016-01-15T03:31:39Z","updated_at":"2016-01-15T03:31:39Z","body":"closing since this was resolved on the `relative` lib"}}