2017-01-26 12:56:40 +00:00
|
|
|
/**
|
2018-02-17 02:24:55 +00:00
|
|
|
* Copyright (c) 2014-present, Facebook, Inc.
|
2017-01-26 12:56:40 +00:00
|
|
|
*
|
2018-02-17 02:24:55 +00:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2017-10-31 10:44:59 +00:00
|
|
|
*
|
|
|
|
* @format
|
2017-01-26 12:56:40 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
const fs = require('fs');
|
|
|
|
const path = require('path');
|
|
|
|
|
|
|
|
const PACKAGES_DIR = path.resolve(__dirname, '../packages');
|
|
|
|
|
|
|
|
// Get absolute paths of all directories under packages/*
|
|
|
|
module.exports = function getPackages() {
|
2017-05-22 10:51:24 +00:00
|
|
|
return fs
|
|
|
|
.readdirSync(PACKAGES_DIR)
|
2017-01-26 12:56:40 +00:00
|
|
|
.map(file => path.resolve(PACKAGES_DIR, file))
|
|
|
|
.filter(f => fs.lstatSync(path.resolve(f)).isDirectory());
|
|
|
|
};
|