Skip to content
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

visdebug - check for different adapter directories #111

Merged
merged 1 commit into from
Jan 21, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 20 additions & 1 deletion lib/setup/setupVisDebug.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,26 @@ function VisDebug(options) {
}

this.enableDebug = function (widgetset) {
var adapterDir = tools.getAdapterDir('vis-' + widgetset);

//Try to find out the adapter directory out of a list of options
var adapterDir;
var adapterNames2Try=["vis-"+widgetset, widgetset];
for (i in adapterNames2Try) {
try {
var adapterDir2Try = tools.getAdapterDir(adapterNames2Try[i]);
// Query the entry
var stats = fs.lstatSync(adapterDir2Try);

// Is it a directory?
if (stats.isDirectory()) {
//found it!
adapterDir = adapterDir2Try;
break;
}
} catch (e) {};
}
if (!adapterDir) throw "Adapter not found. Tried: "+adapterNames2Try;

// copy index.html.original to index.html
// copy edit.html.original to edit.html
// correct iobroker.json
Expand Down