'use strict' ; import * as homeDir from 'home-dir' ; export class FileSystemUtil { param { String } dir returns { String } public static getDirPath ( dir ) { if ( dir . startsWith ( '~' ) ) { const CHE_PROJECTS_ROOT = process . env . CHE_PROJECTS_ROOT ; if ( CHE_PROJECTS_ROOT ) { dir = dir . replace ( '~' , CHE_PROJECTS_ROOT ) ; } else { dir = homeDir ( dir . replace ( '~' , '' ) ) ; } } return dir ; } }