Skip to content

Commit

Permalink
Merge pull request #1 from salsita/no-pretty-path
Browse files Browse the repository at this point in the history
use "path" instead of "pretty_path"
  • Loading branch information
Roman Kaspar authored May 5, 2017
2 parents c5c2c97 + 62f7cb6 commit 998949b
Show file tree
Hide file tree
Showing 3 changed files with 3,118 additions and 3 deletions.
7 changes: 5 additions & 2 deletions code/lib/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,15 @@ const cciArtifactsInfoHandler = (err, res) => {
} else { // res.ok
console.log('Response from CCI server:\n' + JSON.stringify(res.body, null, 4));
const prefixes = config.artifacts.map(item => {
return { name: '$CIRCLE_ARTIFACTS/' + item, found: false };
return { name: item, found: false };
});
const urls = [];
res.body.forEach(item => {
// strip first two segments of the path (that might start with leading /)
let mpath = item.path[0] === '/' ? item.path.substr(1) : item.path;
mpath = mpath.split('/').slice(2).join('/');
prefixes.forEach(prefix => {
if (item.pretty_path.startsWith(prefix.name)) {
if (mpath.startsWith(prefix.name)) {
urls.push(item.url);
prefix.found = true;
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cci-pingu",
"version": "1.3.0",
"version": "1.3.1",
"description": "Periodically check for new builds (artifacts) on CircleCI and install them in turn.",
"license": "MIT",
"author": "Roman Kaspar <[email protected]>",
Expand Down
Loading

0 comments on commit 998949b

Please sign in to comment.