Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Yakiyo/dsm

Repository files navigation

DSM - Dart SDK Manager

ci

Simplified version manager for the Dart SDK. Inspired by fnm and nvm.

Installation

crates.io:

$ cargo install dsm

Locally

Clone the repo first. Then build it. You need the rust toolchain installed in your local environment. Get it from here. You also need git.

$ git clone https://github.com/Yakiyo/dsm

$ cd dsm

$ cargo build --release

Pre-built binaries

Pre-built binaries for some platforms are available in github releases section. You can download the file, rename it and add it to your system PATH.

Scripts

Installation scripts will be added soon. If you'd like to contribute, please see #10

After installation, setup your shell as mentioned in setup.

Setup

The dsm env <SHELL> command is used for setting up shell. Currently powershell, bash. zsh, cmd and fish are supported.

Bash/Zsh

Add the following to your .bashrc or .zshrc file.

eval $(dsm env bash)
# or for zsh
eval $(dsm env zsh)

Fish

Create ~/.config/fish/conf.d/dsm.fish and add the following.

dsm env fish | source

Powershell

Add the following to your powershell profile

dsm env powershell | Out-String | Invoke-Expression

You can view the path to your profile with the $PROFILE variable.

Command Prompt

Create a startup script and add the following.

FOR /f "tokens=*" %i IN ('dsm env cmd') DO CALL %i

Usage

For installing a specific version

$ dsm install 3.0.3

You can use latest to install the latest stable sdk version. Latest versions of dev/beta channels are also supported via latest/channel or latest-channel format.

$ dsm install latest-dev # or dsm install latest/dev

$ dsm install latest # same as latest-stable or latest/stable

Then use the use command to activate it

$ dsm use 3.0.3

For creating aliases, use the alias and unalias commands

$ dsm alias 3.0.3 pinned

$ dsm unalias pinned

View all installed versions

$ dsm ls # or dsm list

For a list of all commands, do dsm --help.

Contributing

Contributions are always welcome. You can start with any of the open issues to work on. For adding a new feature, please open an issue before working on it in order to discuss it. Feature commits are prefered so please open individual prs for individual features instead of doing several feature additions/changes in a single pull request. For any changes, add a changeset via pnpm changeset if its applicable.

Make sure your code passes the CI and please merge and resolve conflicts from upstream before finalizing the pr.

If you cannot code yourself but would like to request a feature, please open an issue and I'll see what can be done.

Credits

A huge amount of code and inspiration has been taken from Schniz's fnm. The project structure, some of the hacks and codes are based from it.

Author

dsm © Yakiyo. Authored and maintained by Yakiyo.

Released under MIT License

If you like this project, consider leaving a star ⭐ and sharing it with your friends and colleagues.