Add UnpackState and DownloadState
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
const { Injectable } = require('flitter-di')
|
||||
const moment = require('moment')
|
||||
const path = require('path')
|
||||
|
||||
class UniversalPath extends Injectable {
|
||||
static get services() {
|
||||
@@ -56,6 +57,12 @@ class UniversalPath extends Injectable {
|
||||
return this.is_file() || this.is_directory()
|
||||
}
|
||||
|
||||
async directory() {
|
||||
await this.classify()
|
||||
if ( this.is_directory() ) return this.path
|
||||
return path.dirname(this.path)
|
||||
}
|
||||
|
||||
async classify() {
|
||||
const dir_result = await this._host.execute(`${this._directory_classify_command} ${this._path}`)
|
||||
if ( dir_result.exit_code === 0 ) {
|
||||
|
||||
Reference in New Issue
Block a user