Skip to content

Adapt to control repo npm installation #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 31, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions src/stores/ContentRepositoryStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,12 @@ class ContentRepositoryStore {
r.contentContainer = contentContainer;
r.presenterContainer = presenterContainer;

let prepareContent = () => ContentRepositoryUtil.launchContentPreparer(r);
let prepareControl = () => ContentRepositoryUtil.launchControlPreparer(r);

prepareContent();
prepareControl();
ContentRepositoryUtil.launchContentPreparer(r);
ContentRepositoryUtil.launchControlPreparer(r);

let installWatcher = (root, fn, callback) => {
let ignored = ['_build/**', '_site/**', '.git/**', '.DS_Store', 'npm-debug.log', 'build'];
let ignored = ['_build/**', '_site/**', '.git/**', '.DS_Store', 'npm-debug.log', 'build',
'**/node_modules/**'];
let gitignorePath = path.join(root, ".gitignore");

fs.readFile(gitignorePath, {encoding: 'utf-8'}, (error, content) => {
Expand All @@ -83,7 +81,16 @@ class ContentRepositoryStore {
});
};

let prepareContent = (path) => {
console.log("Launching content preparer because of a change to: " + path);
ContentRepositoryUtil.launchContentPreparer(r)
};
installWatcher(r.contentRepositoryPath, prepareContent, (w) => r.contentWatcher = w);

let prepareControl = (path) => {
console.log("Launching control preparer because of a change to: " + path);
ContentRepositoryUtil.launchControlPreparer(r);
};
installWatcher(r.controlRepositoryLocation, prepareControl, (w) => r.controlWatcher = w);
}

Expand Down
2 changes: 1 addition & 1 deletion src/utils/ContentRepositoryUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ export default {
],
HostConfig: {
Binds: [
repo.controlRepositoryLocation + ':/var/control-repo:ro',
repo.controlRepositoryLocation + ':/var/control-repo',
controlOverrideDir + ':/var/override:ro'
],
Links: [ "content-" + repo.id + ":content" ],
Expand Down