chef-cft / wombat

Wombat helps make Chef demos delightful
22 stars 6 forks source link

cmder is missing chef module #228

Open SteveDelFante opened 8 years ago

SteveDelFante commented 8 years ago

Hwne I run this from cmder, I get the recipe[recipes] bug

knife node run_list add union "recipe[site_config-3]"
union:
  run_list:
    recipe[bjc_bass]
    recipe[site-config]
    recipe[bjc-ecommerce]
    recipe[recipes]

But, it works on the ChefDK shortcut on the desktop. :

knife node run_list add union "recipe[site_config-3]"
union:
  run_list:
    recipe[bjc_bass]
    recipe[site-config]
    recipe[bjc-ecommerce]
    recipe[recipes]
    recipe[site_config-3]
binamov commented 8 years ago

the chefdk link launches this ps1, which loads the module:

 gc C:\opscode\chefdk\bin\start-chefdk.ps1
Try {
    $conemulocation = "$env:programfiles\ConEmu\Conemu64.exe"
    # We don't want the current path to affect which "chef shell-init powershell" we run, so we need to set th
e PATH to include the current omnibus.
    $chefdk_bin = (split-path $MyInvocation.MyCommand.Definition -Parent)
    $chefdkinit = '"$env:PATH = ''' + $chefdk_bin + ';'' + $env:PATH; $env:CHEFDK_ENV_FIX = 1; chef shell-init
 powershell | out-string | iex; Import-Module chef -DisableNameChecking"'
    $chefdkgreeting = "echo 'PowerShell $($PSVersionTable.psversion.tostring()) ($([System.Environment]::OSVer
sion.VersionString))';write-host -foregroundcolor darkyellow 'Ohai, welcome to ChefDK!`n'"
    $chefdkcommand = "$chefdkinit;$chefdkgreeting"
    $chefdktitle = "Administrator: ChefDK ($env:username)"

    if ( test-path $conemulocation )
    {
        start-process $conemulocation -verb runas -argumentlist '/title',"`"$chefdktitle`"",'/cmd','powershell
.exe','-noexit','-command',$chefdkcommand
    }
    else
    {
        start-process powershell.exe -verb runas -argumentlist '-noexit','-command',"$chefdkcommand; (get-host
).ui.rawui.windowtitle = '$chefdktitle'"
    }
}
Catch
{
    sleep 10
    Throw
}
andrewelizondo commented 8 years ago

so we should probably figure out how to put this same logic in the powershell profile on the workstation so it happens every time.