-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export-PSGraph does not find graphviz on Ubuntu in default location #78
Comments
Absolutely. That looks like a good path to add to the list. |
PR submitted. I know you have login in Install-GraphViz for Windows and MacOS. For Linux, because of the variability in distos and package managers, I'm not sure of the best options for this command. For ubuntu (and other debian distros), you would use |
Add '/usr/bin/dot' as a default location for GraphVizPath. To support Ubuntu. Issue #78
I wasn't sure how to handle all those possibilities either and I'm not sure that command belongs in this module. |
I was thinking more displaying the command but not executing it |
I would be good with that solution. That lets the user make the call. I guess I we should also include a link to the graphviz documentation on how to download it. https://www.graphviz.org/download |
hi, guys, I think it would be too bad to have the user usability be diffferent for linux then for macosx and windows. <#
.Description
Installs GraphViz package using online provider
.Example
Install-GraphViz
#>
[cmdletbinding( SupportsShouldProcess = $true, ConfirmImpact = "High" )]
param()
process
{
try
{
if ( $IsOSX )
{
if ( $PSCmdlet.ShouldProcess( 'Install graphviz' ) )
{
brew install graphviz
}
}Elseif($IsLinux){
#Get the version, with something like this:
#https://www.cyberciti.biz/faq/how-to-check-os-version-in-linux-command-line/
$LinuxOs = ""
switch($LinuxOs){
"RHEL" {yum graphviz;break}
"Ubuntu"{sudo apt install graphviz;break}
"Default"{throw "Os not supported yet. please open an issue here: https://github.com/KevinMarquette/PSGraph/issues"}
}
}
else
{
if ( $PSCmdlet.ShouldProcess('Register Chocolatey provider and install graphviz' ) )
{
if ( -Not ( Get-PackageProvider | Where-Object ProviderName -eq 'Chocolatey' ) )
{
Register-PackageSource -Name Chocolatey -ProviderName Chocolatey -Location http://chocolatey.org/api/v2/
}
Find-Package graphviz | Install-Package -Verbose -ForceBootstrap
}
}
}
catch
{
$PSCmdlet.ThrowTerminatingError( $PSitem )
}
} I have no linux machine to test this one unfortunatley. perhaps @tigerfansga could give it a shot? |
One option to look at these is WSL on Windows 10. I can do some checking on a few different distributions, but the variability in the Linux world will create gaps. I can't confirm, but you will most likely need to use sudo for REHL with yum. |
On Ubuntu, the default install location is
/usr/bin/dot
I feel this should be added to the default search listIf you agree, I can do a PR if you like.
The text was updated successfully, but these errors were encountered: