import * as path from 'path' ; import { cp , mkdir , rm , tempdir } from 'shelljs' ; export function createWorkspace ( assetToSeedPath ) { const tmpDir = tempdir ( ) ; const prefix = ( Date . now ( ) + Math . round ( Math . random ( ) * 1000 ) ) . toString ( ) ; const workspacePath = path . join ( tmpDir , prefix ) ; mkdir ( '-p' , workspacePath ) ; cp ( '-R' , assetToSeedPath , workspacePath ) ; return path . join ( workspacePath ) ; } export function removeWorkspace ( pathToRemove ) { rm ( '-rf' , pathToRemove ) ; }