1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | 2x 1x 1x 1x 1x | /**
* User directory path Redux reducer
* @param {string} dir default user directory path
* @returns string user directory path
*/
export default function dirReducer(
dir: string
): string {
if (!atom) {
throw new Error('No project directory found. Atom may not be initialized.');
}E
if (atom && atom.project.rootDirectories.length > 0) {
return atom.project.rootDirectories[0].path;
}
return dir;
}
|