2017-10-07 15:27:58 +00:00
|
|
|
import { Injectable } from '@angular/core'
|
|
|
|
import { ConfigService } from 'terminus-core'
|
|
|
|
|
|
|
|
import { ShellProvider, IShell } from '../api'
|
|
|
|
|
|
|
|
@Injectable()
|
|
|
|
export class CustomShellProvider extends ShellProvider {
|
|
|
|
constructor (
|
|
|
|
private config: ConfigService,
|
|
|
|
) {
|
|
|
|
super()
|
|
|
|
}
|
|
|
|
|
|
|
|
async provide (): Promise<IShell[]> {
|
2017-10-21 20:11:27 +00:00
|
|
|
let args = this.config.store.terminal.customShell.split(' ')
|
2017-10-07 15:27:58 +00:00
|
|
|
return [{
|
|
|
|
id: 'custom',
|
|
|
|
name: 'Custom',
|
2017-10-21 20:11:27 +00:00
|
|
|
command: args[0],
|
|
|
|
args: args.slice(1),
|
2017-10-07 15:27:58 +00:00
|
|
|
}]
|
|
|
|
}
|
|
|
|
}
|