-
Notifications
You must be signed in to change notification settings - Fork 2
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
Don't throw an error on missing russrc #6
Conversation
…aintain concatenation order
…aintain concatenation order
…ng with pre/post hooks
} catch (err) { | ||
throw Error('Missing russ files...'); | ||
} | ||
} catch (err) { } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure tasks
need to be defined twice here. But, based on #5 this path will likely need to be a variable that's defined based on whether the config
exists and a key is set or a command line option has been set to define the task directory.
@@ -176,7 +175,7 @@ var RussInstance = function () { | |||
var isDel = opts.concurrent || opts.sequence; | |||
if (opts.name && opts.doc && (hasFunc || isDel)) _this4.tasks[opts.name] = opts;else throw new Error(ERR_MSG); | |||
}; | |||
if (files.length === 0) throw new Error('No tasks defined in russ.tasks'); | |||
if (!files || files.length === 0) throw new Error('No tasks defined in russ.tasks'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If tasks
definition is left inside try/catch
the file
check within register
shouldn't be necessary, it will either throw an error because the directory doesn't exist or will throw an error that no tasks are defined because of an empty files
array. In which case the check could just simply be:
if (!files.length) throw new Error('No tasks defined in russ.tasks');
Should be optional if user doesn't need to put anything in it.