JanDeDobbeleer / aliae

Cross shell and platform alias management
https://aliae.dev
MIT License
73 stars 3 forks source link

init in pwsh profile throws error #2

Closed DavidDeSloovere closed 1 year ago

DavidDeSloovere commented 1 year ago

Code of Conduct

What happened?

Thanks for starting this great project. Couldn't wait and had to try it out already. Being early adopter I ran into this issue.

After adding aliae init pwsh | Invoke-Expression to the powershell profile (as per docs) I get the following error: Invoke-Expression: Cannot bind argument to parameter 'Command' because it is an empty string.

I also have oh-my-posh init pwsh --config "~/.mytheme.omp.json" | Invoke-Expression in my profile, and that works without a problem 😉.

Running aliae init pwsh | Invoke-Expression in terminal (powershell) returns the same error.

Running aliae init pwsh returns (@(& aliae init pwsh --config= --print) -join "``n") | Invoke-Expression. With a single "`", just markdown issues here in GH.

PowerShell 7.3.5

What OS are you seeing the problem on?

Windows

Which shell are you using?

powershell

JanDeDobbeleer commented 1 year ago

@DavidDeSloovere I'll check this evening. Have to admit I validated on macOS using core, will run a few checks cross platform as well.

Can it be you don't have a configuration yet? Because that could result in an empty string being invoked.

DavidDeSloovere commented 1 year ago

Looks like v0.1.1 is not ID10T proof yet :-) I had created a YAML, but it was empty. Following the instructions, you start with the installation and init. And later there'a page on the config.

Edits: Changing the order in the docs might be good enough, until there's a check against an empty config. A default config could also be created. I don't think anyone would mind that. I can contribute to the docs, but don't know Go.

JanDeDobbeleer commented 1 year ago

I was aware of this gap, changing the order definitely is a good idea though! I want to create a nice CLI to easily add aliases as well.