Warning: If you want to give these dotfiles a try, you should first fork this repository, review the code, and remove things you don’t want or need. Don’t blindly use my settings unless you know what that entails. Use at your own risk!
You can clone the repository wherever you want (I like to keep it in ~/Piscine/dotfiles
).
The bootstrapper script will pull in the latest version and copy the files to your home folder.
# Clone this repository
git clone https://github.com/fredsiika/piscine.git
# Move into the dotfiles directory
cd piscine/dotfiles
# To Update, start the bootstrap script
source bootstrap.sh
Alternatively, to update while avoiding the confirmation prompt:
set -- -f; source bootstrap.sh
To install these dotfiles without Git:
cd; curl -#L https://github.com/fredsiika/piscine/tarball/master | tar -xzv --strip-component 1 --exclude={README.md,bootstrap.sh,.osx,LICENSE-MIT.txt}
To update later on, just run that command again.
Due to local environment configuration set by 42 Silicon's admins, we do not have 'sudoer' (root) access. Commands like bash chmod +x <file-name>
do not work resulting in an EACES error when trying to install a node package globally.
Fortunately there's a workaround by changing the directory where npm is installed.
To minimize the chance of permissions errors, you can configure npm to use a different directory. In this example, it will be a hidden directory on your home folder.
- Make a directory for global installations:
mkdir ~/.npm-global
- Configure npm to use the new directory path:
npm config set prefix '~/.npm-global'
- Open or create a ~/.profile file and add this line:
export PATH=~/.npm-global/bin:$PATH
- Back on the command line, update your system variables:
- On the command line, update your system variables:
source ~/.profile
- To test your new configuration, install a package globally without using
**sudo**
:
npm install -g jshint
Instead of steps 2-4, you can use the corresponding ENV variable (e.g. if you don’t want to modify ~/.profile ):
NPM_CONFIG_PREFIX=~/.npm-global
Here's the official tutorial from NPM.
When setting up a new Mac, you may want to set some sensible macOS defaults:
./.macos
Suggestions/improvements welcome!
Fred Siika
Follow @fredsiika on
Twitter
- Mathias Bynens
- @ptb and his macOS Setup repository
- Cătălin Mariș and his dotfiles repository