build fix

This commit is contained in:
Eugene Pankov
2019-03-04 21:03:36 +01:00
parent 27fb611166
commit bcc4a262e2
5 changed files with 28 additions and 14 deletions

View File

@@ -1,10 +1,13 @@
import * as path from 'path'
import { Injectable } from '@angular/core'
import { getRegistryValue, HK } from 'windows-native-registry'
import { HostAppService, Platform } from 'terminus-core'
import { ShellProvider, IShell } from '../api'
try {
var wnr = require('windows-native-registry') // tslint:disable-line
} catch { } // tslint:disable-line
@Injectable()
export class Cygwin32ShellProvider extends ShellProvider {
constructor (
@@ -18,7 +21,7 @@ export class Cygwin32ShellProvider extends ShellProvider {
return []
}
let cygwinPath = getRegistryValue(HK.LM, 'Software\\WOW6432Node\\Cygwin\\setup', 'rootdir')
let cygwinPath = wnr.getRegistryValue(wnr.HK.LM, 'Software\\WOW6432Node\\Cygwin\\setup', 'rootdir')
if (!cygwinPath) {
return []

View File

@@ -1,10 +1,13 @@
import * as path from 'path'
import { Injectable } from '@angular/core'
import { getRegistryValue, HK } from 'windows-native-registry'
import { HostAppService, Platform } from 'terminus-core'
import { ShellProvider, IShell } from '../api'
try {
var wnr = require('windows-native-registry') // tslint:disable-line
} catch { } // tslint:disable-line
@Injectable()
export class Cygwin64ShellProvider extends ShellProvider {
constructor (
@@ -18,7 +21,7 @@ export class Cygwin64ShellProvider extends ShellProvider {
return []
}
let cygwinPath = getRegistryValue(HK.LM, 'Software\\Cygwin\\setup', 'rootdir')
let cygwinPath = wnr.getRegistryValue(wnr.HK.LM, 'Software\\Cygwin\\setup', 'rootdir')
if (!cygwinPath) {
return []

View File

@@ -1,10 +1,13 @@
import * as path from 'path'
import { Injectable } from '@angular/core'
import { getRegistryValue, HK } from 'windows-native-registry'
import { HostAppService, Platform } from 'terminus-core'
import { ShellProvider, IShell } from '../api'
try {
var wnr = require('windows-native-registry') // tslint:disable-line
} catch { } // tslint:disable-line
@Injectable()
export class GitBashShellProvider extends ShellProvider {
constructor (
@@ -18,10 +21,10 @@ export class GitBashShellProvider extends ShellProvider {
return []
}
let gitBashPath = getRegistryValue(HK.LM, 'Software\\GitForWindows', 'InstallPath')
let gitBashPath = wnr.getRegistryValue(wnr.HK.LM, 'Software\\GitForWindows', 'InstallPath')
if (!gitBashPath) {
gitBashPath = getRegistryValue(HK.CU, 'Software\\GitForWindows', 'InstallPath')
gitBashPath = wnr.getRegistryValue(wnr.HK.CU, 'Software\\GitForWindows', 'InstallPath')
}
if (!gitBashPath) {

View File

@@ -1,8 +1,11 @@
import { Injectable } from '@angular/core'
import { getRegistryValue, HK } from 'windows-native-registry'
import { HostAppService, Platform } from 'terminus-core'
import { ShellProvider, IShell } from '../api'
try {
var wnr = require('windows-native-registry') // tslint:disable-line
} catch { } // tslint:disable-line
@Injectable()
export class PowerShellCoreShellProvider extends ShellProvider {
constructor (
@@ -16,7 +19,7 @@ export class PowerShellCoreShellProvider extends ShellProvider {
return []
}
const pwshPath = getRegistryValue(HK.LM, 'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\pwsh.exe', '')
const pwshPath = wnr.getRegistryValue(wnr.HK.LM, 'SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\pwsh.exe', '')
if (!pwshPath) {
return []

View File

@@ -1,14 +1,16 @@
import * as fs from 'mz/fs'
import slug from 'slug'
import { getRegistryKey, listRegistrySubkeys, HK } from 'windows-native-registry'
import { Injectable } from '@angular/core'
import { HostAppService, Platform } from 'terminus-core'
import { ShellProvider, IShell } from '../api'
import { isWindowsBuild, WIN_BUILD_WSL_EXE_DISTRO_FLAG } from '../utils'
try {
var wnr = require('windows-native-registry') // tslint:disable-line
} catch { } // tslint:disable-line
@Injectable()
export class WSLShellProvider extends ShellProvider {
constructor (
@@ -36,7 +38,7 @@ export class WSLShellProvider extends ShellProvider {
}]
const lxssPath = 'Software\\Microsoft\\Windows\\CurrentVersion\\Lxss'
let lxss = getRegistryKey(HK.CU, lxssPath)
let lxss = wnr.getRegistryKey(wnr.HK.CU, lxssPath)
if (!lxss || !lxss.DefaultDistribution || !isWindowsBuild(WIN_BUILD_WSL_EXE_DISTRO_FLAG)) {
if (await fs.exists(bashPath)) {
return [{
@@ -52,8 +54,8 @@ export class WSLShellProvider extends ShellProvider {
return []
}
}
for (let child of listRegistrySubkeys(HK.CU, lxssPath)) {
let childKey = getRegistryKey(HK.CU, lxssPath + '\\' + child)
for (let child of wnr.listRegistrySubkeys(wnr.HK.CU, lxssPath)) {
let childKey = wnr.getRegistryKey(wnr.HK.CU, lxssPath + '\\' + child)
if (!childKey.DistributionName) {
continue
}