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

Don't throw an error on missing russrc #6

Closed
wants to merge 130 commits into from
Closed

Conversation

JonDum
Copy link

@JonDum JonDum commented Jun 28, 2017

Should be optional if user doesn't need to put anything in it.

jh3y and others added 30 commits October 21, 2015 18:25
} catch (err) {
throw Error('Missing russ files...');
}
} catch (err) { }
Copy link
Owner

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');
Copy link
Owner

@jh3y jh3y Jun 30, 2017

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');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants