mirror of
https://github.com/xodio/xod.git
synced 2026-03-03 07:24:03 +01:00
19 lines
461 B
JavaScript
19 lines
461 B
JavaScript
import path from 'path';
|
|
import os from 'os';
|
|
import fs from 'fs-extra';
|
|
|
|
export const createWorkingDirectory = prefix =>
|
|
fs.mkdtempSync(path.resolve(os.tmpdir(), `xod-cli-test-${prefix}-`));
|
|
|
|
export const bundledWorkspacePath = path.resolve(
|
|
__dirname,
|
|
'..',
|
|
'bundle',
|
|
'workspace'
|
|
);
|
|
|
|
export const getFilesFromPath = (p, extension) => {
|
|
const dir = fs.readdirSync(p);
|
|
return dir.filter(el => el.match(new RegExp(`.*.(${extension})$`, 'ig')));
|
|
};
|