question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature request: add optional tasks

See original GitHub issue

I would like Dotbot to install the required softwares by my dotfiles. For instance, if I use i3, I would add to install.conf.yaml:

- shell:
    - sudo apt-get install -y i3

- link:
    - ~/.config/i3/config: i3/config

But imagine I need multiple softwares like fish, tmux, Vim, etc. and with multiple package managers (npm install -g bower gulp yo, sudo pip install pre-commit pre-commit-hooks thefuck, etc.), each time I run ./install, the whole installation process will take several minutes to run, especially on low resource systems such as the Raspberry Pi v1.

I know Dotbot should be idempotent, but wouldn’t be great to run ./install --init or something to execute specific part of the file (for instance, install the required softwares)? Then, the install.conf.yaml would become:

- optional:
    # Only executed if `--init` is specified
    - name: init
      tasks:
        - shell:
            - [sudo apt-get install -y i3, Installing required softwares]

# Executed in any case
- link:
    - ~/.config/i3/config: i3/config

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
gwerbincommented, Jan 18, 2017

However, letting tasks have some kind of name or group attribute seems like a useful feature to have in the core program. Then you can resolve https://github.com/anishathalye/dotbot/issues/81 easily by grouping the output together for tasks that share a groups attribute:

- groups:
  - "init"
  shell:
    - [sudo apt-get install -y i3, Installing required softwares]

- link:
    - ~/.config/i3/config: i3/config

Alternatively you can require that all additional attributes have to be specified in an “attributes” element, which can then be passed on to plugins etc:

- shell:
    - [sudo apt-get install -y i3, Installing required softwares]
  attributes:
  - "optional"
  - name: "install-i3"
  - groups: ["init"]

- link:
    - ~/.config/i3/config: i3/config

Heck, this way you could even have a depends-on attribute and then write a plugin to resolve dependencies or something, or an arguments attribute that fills in templated strings, etc. Pretty sure you could re-implement Make this way if you really wanted to, but again with the benefit of it only existing outside the core program.

2reactions
gwerbincommented, Jan 18, 2017

Obviously @anishathalye you have the final word here, but I’d be concerned about feature creep. One of Dotbot’s great strengths is that it’s dead simple, and starting to add advanced configuration options might remove some of that simplicity.

You already have a plugin API – I’d much rather see this kind of functionality implemented as a plugin than in the Dotbot core.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add optional tasks via template or pick list - Clarizen Success
Enhancement Request : Add optional tasks via template or pick list. Ability to add optional tasks (ie. bid desk, customer samples, ...
Read more >
optional inputs to support gradual evolution of tasks ... - GitHub
Our team uses some concourse tasks that are maintained by another team. ... Feature request: optional inputs to support gradual evolution of ...
Read more >
Feature request: Make link to activity optional - WordPress.org
I have a private Strava account; I'm uninterested in the social features of the site. ... Feature request: Make link to activity optional....
Read more >
Feature request: add an optional transaction size in mode insert
Feature request : add an optional transaction size in mode insert ... For that, I use this idiom: $ sqlite3 -cmd '.mode insert...
Read more >
Tasks: Support todo.txt format - Feature Requests - Notejoy
Use of the Todo.txt format is optional and implied by the format of the item (i.e.: it doesn't need to specified in the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found