DEV Community 👩‍💻👨‍💻

Cover image for How scoop made my dev experience in Windows so great
Luciano Graziani
Luciano Graziani

Posted on

How scoop made my dev experience in Windows so great

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.

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):

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!

Top comments (3)

Collapse
tqm profile image
TQM

Absolutely! Scoop is a thing of beauty.
It's a nice idea to persist the configuration however that the number of the apps in the persist folder does not match the number of apps installed. What do I miss ?

Collapse
attkinsonjakob profile image
Jakob Attkinson

I started using scoop myself recently. However, not all apps I install are portable. Thus, I don't see how committing the entire scoop folder to a git repo helps.

Secondly, I wish there was a video guide for setting up personal buckets and auto update them. I still haven't been able to do this.

Collapse
lgraziani2712 profile image
Luciano Graziani Author

Absolutely! That's why I configured the git repo inside C:\Users\<user>\scoop\persist instead of the scoop root folder. Furthermore, you wouldn't want to add to the repo the entire persist folder, there are some things like local caches that you don't want to push them.

Secondly, I wish there was a video guide for setting up personal buckets and auto update them. I still haven't been able to do this.

I never thought that but true!

Find what you were looking for? Sign up so you can:

 
🌚 Enable dark mode
🔠 Change your default font
📚 Adjust your experience level to see more relevant content