Checking for correct Rhubarb version
This commit is contained in:
parent
c6ce5fa8b8
commit
9fe37dfbb3
|
@ -455,6 +455,23 @@ function createDialogWindow() {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check for correct Rhubarb version
|
||||||
|
var version = system.callSystem('rhubarb --version') || '';
|
||||||
|
var match = version.match(/Rhubarb Lip Sync version ((\d+)\.(\d+).(\d+))/);
|
||||||
|
if (!match) {
|
||||||
|
var isWindows = (system.osName || $.os).match(/windows/i);
|
||||||
|
return 'Cannot find executable file "' + (isWindows ? 'rhubarb.exe' : 'rhubarb') + '". '
|
||||||
|
+ 'Make sure your PATH environment variable contains the Rhubarb Lip-Sync '
|
||||||
|
+ 'application directory.';
|
||||||
|
}
|
||||||
|
var versionString = match[1];
|
||||||
|
var major = Number(match[2]);
|
||||||
|
var minor = Number(match[3]);
|
||||||
|
if (major != 1 || minor < 3) {
|
||||||
|
return 'This script requires Rhubarb Lip-Sync 1.3.0 or a later 1.x version. '
|
||||||
|
'Your installed version is ' + versionString + ', which is not compatible.';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle changes
|
// Handle changes
|
||||||
|
@ -474,12 +491,12 @@ function createDialogWindow() {
|
||||||
var validationError = validate();
|
var validationError = validate();
|
||||||
if (typeof validationError === 'string') {
|
if (typeof validationError === 'string') {
|
||||||
if (validationError) {
|
if (validationError) {
|
||||||
Window.alert(validationError, 'Invalid input', true);
|
Window.alert(validationError, 'Rhubarb Lip-Sync', true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
app.beginUndoGroup('Rhubarb Lip-Sync: Animation');
|
app.beginUndoGroup('Rhubarb Lip-Sync: Animation');
|
||||||
window.close();
|
window.close();
|
||||||
// TODO: animate
|
|
||||||
app.endUndoGroup();
|
app.endUndoGroup();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue