Add UnpackState and DownloadState

This commit is contained in:
garrettmills
2020-03-03 16:10:10 -06:00
parent 10bded1681
commit 2725f9eac2
8 changed files with 140 additions and 2 deletions

View File

@@ -23,6 +23,7 @@ class Host extends Injectable {
_file_directory_delete_command = `rm -rf "%%RESOURCE%%"`
_resolve_path_command = `readlink -f "%%PATH%%"`
_reboot_command = `reboot`
_change_directory_command = `cd "%%PATH%%"`
constructor(config) {
super()
@@ -106,6 +107,11 @@ class Host extends Injectable {
await this.execute(this._file_directory_delete_command.replace('%%RESOURCE%%', resource_path))
}
get_directory_change_command(path) {
if ( typeof path !== 'string' ) path = path.path
return this._change_directory_command.replace('%%PATH%%', path)
}
async resolve_path(resource_path) {
resource_path = typeof resource_path === 'string' ? resource_path : resource_path.path
return this.run_line_result(this._resolve_path_command.replace('%%PATH%%', resource_path))