removed endswith

pull/1705/head
antelle 2 years ago
parent c7574a6b83
commit 5dd0d51514
No known key found for this signature in database
GPG Key ID: 63C9777AAB7C563C

@ -103,7 +103,7 @@ function checkFilePath(path, ext) {
if (!path) {
throw 'File not specified: ' + ext;
}
if (!path.endsWith('.' + ext)) {
if (path.substr(-(ext.length + 1)) !== '.' + ext) {
throw 'Bad file extension: ' + ext + ' (' + path + ')';
}
var file = Application('System Events').files.byName(path);

Loading…
Cancel
Save