New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@alexlafroscia/dotty

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@alexlafroscia/dotty

Programmatically configure your development environment

  • 2.0.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
5
increased by150%
Maintainers
1
Weekly downloads
 
Created
Source

dotty Build Status

A tool for declaratively managing your command line tools and configuration

The Problem

I had a few computers that I do development work on, and it was a annoying to keep them in sync. I wanted a way to script installing and configuring my tools, but lacked tooling in pure shell scripting with the level of polish I desired. I knew I could build the tool I wanted using Node.js, so... here's dotty!

Installation

On a system that already has Node installed, you can grab dotty as an NPM package from @alexlafroscia/dotty. If you're setting it up on a new machine, a pkg-built binary can be found on the Releases tab.

Usage

Defining tasks

A dotty task looks something like this:

// tasks/brew.js
module.exports = function(Task) {
  return class Homebrew extends Task {
    constructor() {
      super();

      // Set the name of the program being installed
      this.programName = 'brew';
    }

    /**
     * Check if the program needs to be installed
     */
    checkInstallation() {
      return this.which('brew');
    }

    /**
     * Install the program
     */
    install() {
      return this.exec(
        '/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"'
      );
    }
  };
};

Check out the example-tasks directory for more examples that show off the full set of hooks available. The Task source code has additional information on the available hooks and how they interact with each other.

Running tasks

You can invoke dotty like so:

dotty path/to/tasks/directory

I recommend keeping your tasks in a location where they can easily be synchronized between all of your machines, such as a dotfiles repo, iCloud or Dropbox. For example, on my machine, synchronizing a new machine looks like:

dotty $DOTFILES/tasks

since $DOTFILES is aliased to my dotfiles directory.

FAQs

Package last updated on 09 Jan 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc