Comments (4)
:tldr @atomantic is a generous genius.
:whole story:
I guess we are getting to the heart of it. I didnt source azure-cli/az.completion in .zshrc. Im not clear on the steps for adding a new package to this set up. So from the sounds of it, the steps generally to 1. Run the install 2. Add a script sourcing the new executable to your .rc file. In this case, its .zshrc because we are using the .zsh shell. 3. Reset terminal (exec $SHELL or open new terminal).
In this specific case it looks like this. This worked successfully.
- $
curl -L https://aka.ms/InstallAzureCli | bash
.
//output of #1
azure-cli directory: '/Users/devworx/lib/azure-cli'
===> In what directory would you like to place the 'az' executable? (leave blank to use '/Users/devworx/bin'): //left blank
===> Enter a path to an rc file to update (leave blank to use '/Users/devworx/.bash_profile'):
//entered path to .zshrc
/Users/devworx/.zshrc
//output
-- Backed up '/Users/devworx/.dotfiles/homedir/.zshrc' to '/Users/devworx/.dotfiles/homedir/.zshrc.backup'
-- Tab completion set up complete.
-- If tab completion is not activated, verify that '/Users/devworx/.dotfiles/homedir/.zshrc' is sourced by your shell.
--
-- ** Run `exec -l $SHELL` to restart your shell. **
--
-- Installation successful.
-- Run the CLI with /Users/devworx/bin/az --help
This is the newly generated .zshrc
~ cat ~/.zshrc ✓ 1095 10:04:56
# Path to your oh-my-zsh configuration.
export ZSH=$HOME/.dotfiles/oh-my-zsh
# if you want to use this, change your non-ascii font to Droid Sans Mono for Awesome
# POWERLEVEL9K_MODE='awesome-patched'
export ZSH_THEME="powerlevel9k/powerlevel9k"
POWERLEVEL9K_SHORTEN_DIR_LENGTH=2
# https://github.com/bhilburn/powerlevel9k#customizing-prompt-segments
# https://github.com/bhilburn/powerlevel9k/wiki/Stylizing-Your-Prompt
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(dir nvm vcs)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status history time)
# colorcode test
# for code ({000..255}) print -P -- "$code: %F{$code}This is how your text would look like%f"
POWERLEVEL9K_NVM_FOREGROUND='000'
POWERLEVEL9K_NVM_BACKGROUND='072'
POWERLEVEL9K_SHOW_CHANGESET=true
#export ZSH_THEME="random"
# Set to this to use case-sensitive completion
export CASE_SENSITIVE="true"
# disable weekly auto-update checks
# export DISABLE_AUTO_UPDATE="true"
# disable colors in ls
# export DISABLE_LS_COLORS="true"
# disable autosetting terminal title.
export DISABLE_AUTO_TITLE="true"
# Which plugins would you like to load? (plugins can be found in ~/.dotfiles/oh-my-zsh/plugins/*)
# Example format: plugins=(rails git textmate ruby lighthouse)
plugins=(colorize compleat dirpersist autojump git gulp history cp)
source $ZSH/oh-my-zsh.sh
test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"
source /usr/local/opt/nvm/nvm.sh
autoload -U add-zsh-hook
load-nvmrc() {
if [[ -f .nvmrc && -r .nvmrc ]]; then
nvm use &> /dev/null
elif [[ $(nvm version) != $(nvm version default) ]]; then
nvm use default &> /dev/null
fi
}
add-zsh-hook chpwd load-nvmrc
load-nvmrc
# Customize to your needs...
unsetopt correct
# run fortune on new terminal :)
fortune
export PATH=$PATH:/Users/devworx/bin
source '/Users/devworx/lib/azure-cli/az.completion'
Running exec -l $SHELL
gets the command not found error.
Use the Force, Luke.
/Users/devworx/lib/azure-cli/az.completion:10: command not found: complete
Then followed your instruction adding 'autoload bashcompinit && bashcompinit '(even though i have no idea what that is, will research)
~ nvim ~/.zshrc 127 ↵ 1096 10:06:18
...
autoload bashcompinit && bashcompinit
source '/Users/devworx/lib/azure-cli/az.completion'
....
~ exec -l $SHELL
Then run az
:
az ✓ 1099 10:08:29
/\
/ \ _____ _ _ __ ___
/ /\ \ |_ / | | | \'__/ _ \
/ ____ \ / /| |_| | | | __/
/_/ \_\/___|\__,_|_| \___|
Welcome to the cool new Azure CLI!
Here are the base commands:
account : Manage subscriptions.
....
I figured I would leave this here in case it helps anyone else. Thus the details...
from dotfiles.
usually, cli tools will add something to your shell rc file as part of the install process--and it looks like it did do something of that sort since your shell is trying to load /Users/devworx/lib/azure-cli/az.completion when you open a new tab.
It looks like this may be a bug in the azure-cli with support for the version of zsh that you have installed: Azure/azure-cli#1722
berndverst commented on Feb 5
I just noticed that zsh version 5.2 is not the latest. For some reason I wasn't managing it via homebrew, so I updated my install with brew install zsh. Now running zsh 5.3.1 (x86_64-apple-darwin16.3.0) I no longer get this error.
@niemyjski perhaps upgrading your zsh will fix this for you too? 🤷♂️
from dotfiles.
I checked the version and its correct. So from your answer, you would expect that a new npm install would get you access to an executable without having to do anything else. It doesnt seem to be working so smoothly for me.
from dotfiles.
I wouldn't expect this to be an npm issue--the azure cli is outside of npm. The problem points to this line: https://github.com/Azure/azure-cli/blob/1271aa0cad486b8c61cc788c912f3e87092bb104/packaged_releases/az.completion#L21
The complete
command/function doesn't exist.
Did you try adding: autoload bashcompinit && bashcompinit
to .zshrc before the line sourcing azure-cli/az.completion
?
from dotfiles.
Related Issues (20)
- ? mark in iterm HOT 6
- How to add personal hosts to /etc/hosts? HOT 3
- Support for iTerm2? HOT 1
- Preferable option for passwordless sudo? HOT 1
- installation freezes at HOT 2
- Want Brewfile? HOT 5
- Terminal exits just after iTerm is launched
- Any thoughts to using "bat" inplace of "cat" HOT 2
- Why are my .bash_aliases and .bash_profile ignored after the instal.sh script is done? HOT 2
- Command line loading speed is too slow HOT 2
- Font installation from Homebrew fails HOT 2
- Setting for saving to disk by default not iCloud has obliterated my local copies of Documents, Desktop, etc. HOT 2
- iTerm load times. HOT 2
- Support for Java things
- Problem with print_result (Line 173 + 179 of Install Script) HOT 1
- Potential typo in require_brew() function
- VIM plugins stage takes three hours or more HOT 8
- brew --with-default-names option is deprecated
- Terminal is bricked HOT 2
- Interview partners for research about communication in GitHub projects wanted
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dotfiles.