How scoop made my dev experience in Windows so great
Tags: beginners, windows, scoop
Published: 2018-10-17 18:07:15

---
Cover image from: https://wallpaperstudio10.com/wallpaper-nature_road-73863.html?index=28
---

Since I started programming, I used Windows for the most part. I always had problems while configuring everything I needed every time I formatted the PC or changed it. At the beggining I tried to use xamp or wamp, but I was uncomfortable with those tools, things were difficult to update, change and share configuration between teammates.

The windows' `cmd` is extremely uncomfortable for me too. Since I learned to use the CLI with Linux (vi 4ever, lol). I felt in love at first sight when I started using Cmder.

I've been working with a 4-person team mainly using nodejs or php7.2 in the backend and vue in the frontend. Early this year, when we started a new project, I truly wanted to share how I configured my dev environment with them since everyone uses Windows.

I started searching some package manager but for Windows. I found chocolatey first, and I tried it but I didn't like it (I don't remember why). So I continued searching until I found `scoop`.

## Scoop

> Scoop is a command-line installer for Windows.

- Github repository: https://github.com/lukesampson/scoop

This tool made my dev environment configuration a breeze. I could even create a git repository and store every configuration for every tool. This allowed me and my teammates to install, keep updated and configure everything from php (with x-debug), apache, nodejs, yarn, mariadb, composer, cmder, and other general tools like gimp, screentogif (another excellent oss tool) or filezilla in less than an hour.

Today I had to install everything from scratch in another laptop and I only had to install scoop, clone the configuration repo and start installing everything else.

## So how I can start using scoop with a git repo?

First of all, you have to install scoop (extracted from the official page):

### Requirements

- Windows 7 SP1+ / Windows Server 2008+
- PowerShell 3 (or later) and .NET Framework 4.5+
- PowerShell must be enabled for your user account e.g.

    `set-executionpolicy remotesigned -s currentuser`

### Installation

Run this command from your PowerShell to install scoop to it's default location (C:\Users\<user>\scoop):

```sh
iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
```

### Create your configuration repository

Considering you installed scoop at the default location (C:\Users\<user>\scoop), you have to access the `C:\Users\<user>\scoop\persist` folder. Every scoop app will store their configuration in this folder which isn't affected by uninstalls. Then you could run `git init` and start persisting you configuration.

By the way, before you start committing and pushing everything, take into account that there are some special files that we don't want to push. To prevent files like those binaries from mariadb, or nodejs caches, we have to create a `.gitignore` file at the root of the repository, in other words, inside the `persist` folder. It's OK to add custom files to it.

My `.gitignore` has the following values:

```
vendor
cache
data
plugins
composer
nodejs
yarn
log.*
user-ConEmu.xml
.history
*.dmp

```

I also written a `README.md` file with everything everyone needs to know to configure each app by hand, like mariadb, or adding apache and mariadb as a windows services.

Things like configuring php with xdebug, which for me was always cumbersome, for the first time was as easy as install it. By default, when you install `php-xdebug`, scoop creates a `xdebug.ini` file inside `C:\Users\<user>\scoop\persist\php\conf.d\` folder with the following content:

```
zend_extension=C:\Users\<user>\scoop\apps\php-xdebug\current\php_xdebug
```

But the thing is, if I want to have a generic configuration which can be used by everyone, I cannot have absolute paths. The following configuration is what I have:

```
zend_extension=../../../../apps/php-xdebug/current/php_xdebug

[XDebug]
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
```

The new `[XDebug]` configuration allows IDE's like VSCode to debug php code.

## Share the configuration between teammates

Once you started pushing your configuration into your repository, you can now share it. Since the `persist` folder will contain data right after the installation, `git` will complain if you try to clone something inside. To resolve this problem, you have to do the following:

```
git init 

git remote add origin PATH/TO/REPO 

git fetch 

git checkout -t origin/master -f
```

Source: https://stackoverflow.com/a/43287779/2862917


I hope this help to simplify the configuration process to anyone using Windows! Feel free to ask me anything!