Skip to content

Bug: config-helper when given multiple write operations, can overwrite itself #333

@balupton

Description

@balupton

Our semaphore work from #281 needs to be applied to echo-write and config-helper. Or config-helper needs to batch its changes. Or config-helper needs a delay between writes.

# cat /etc/shells
/bin/sh
/bin/bash
/bin/tmux
/sbin/bash
/sbin/sh
21:23:47:/home/balupton/.local/share/dorothy:dev/setup-shell
# config-helper --path=/etc/shells -- --string-find=/usr/bin/bash --string-replace=/usr/bin/bash
Updated configuration file: /etc/shells
21:24:20:/home/balupton/.local/share/dorothy:dev/setup-shell
# cat /etc/shells
/bin/sh
/bin/bash
/bin/tmux
/sbin/bash
/sbin/sh
/usr/bin/bash
21:24:21:/home/balupton/.local/share/dorothy:dev/setup-shell
# config-helper --path=/etc/shells -- --string-find=/usr/bin/bash --string-replace=/usr/bin/bash --string-find=/usr/sbin/bash --string-replace=/usr/sbin/bash --string-find=/sbin/bash --string-replace=/sbin/bash --string-find=/bin/bash --string-replace=/bin/bash --string-find=/usr/bin/sh --string-replace=/usr/bin/sh --string-find=/usr/sbin/sh --string-replace=/usr/sbin/sh --string-find=/sbin/sh --string-replace=/sbin/sh --string-find=/bin/sh --string-replace=/bin/sh --string-find=/bin/tmux --string-replace=/bin/tmux

Updated configuration file: /etc/shells

21:24:46:/home/balupton/.local/share/dorothy:dev/setup-shell
# cat /etc/shells
/bin/sh

/bin/bash

/bin/tmux

/sbin/bash

/sbin/sh

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBroken or unexpected

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions