1
0
Fork 0
mirror of https://codeberg.org/Mo8it/dotfiles.git synced 2024-10-17 20:52:40 +00:00

Add npm, again

This commit is contained in:
Mo 2022-06-30 04:26:32 +02:00
parent 484bb00c1d
commit a0d594e49e
4 changed files with 21 additions and 1 deletions

View file

@ -7,4 +7,4 @@ fi
# User specific environment and startup programs
PATH="$PATH:$HOME/.cargo/bin:$HOME/.npm-global/bin"
PATH="$HOME/.npm-global/bin:$PATH:$HOME/.cargo/bin"

View file

@ -4,4 +4,5 @@ launch fish -c "python ~/.scripts/update.py rpm-ostree"
launch fish -c "python ~/.scripts/update.py flatpak"
launch fish -c "python ~/.scripts/update.py pipx"
launch fish -c "python ~/.scripts/update.py cargo"
launch fish -c "python ~/.scripts/update.py npm"
launch fish -c "python ~/.scripts/update.py nvim"

View file

@ -49,6 +49,17 @@ def cargo_packages(output_dir):
f.write(crate + "\n")
def npm_packages(output_dir):
out = cap_run("npm list --json --location=global")
json_out = json.loads(out)
deps = json_out["dependencies"].keys()
file = output_dir / "npm.txt"
with file.open("w") as f:
for dep in deps:
f.write(dep + "\n")
def pipx_packages(output_dir):
out = cap_run("pipx list --json")
json_out = json.loads(out)
@ -82,6 +93,8 @@ def main():
cargo_packages(output_dir)
npm_packages(output_dir)
if __name__ == "__main__":
main()

View file

@ -58,6 +58,10 @@ def update_nvim():
run('nvim --headless -c "autocmd User PackerComplete quitall" -c "PackerSync"')
def update_npm():
run("npm update --location=global")
def main(input):
if input == "rpm-ostree":
update_rpm_ostree()
@ -69,6 +73,8 @@ def main(input):
update_pipx()
elif input == "nvim":
update_nvim()
elif input == "npm":
update_npm()
else:
print(f"Input {input} not valid!")