👁️ A tool to execute a certain command when a target file is modified.

Related tags

Command-line ojo
Overview

Ojo

Ojo is a simple utility that allows you to execute a specific command each time a certain file is being saved.

Usage

Let's say you are sick the following pandoc command pandoc --toc -s test.md -o test.html each time you do some minor modifications.

Ojo Handles this for you, you just have to specify when to watch for modification and the command to execute and voilà !

ojo test.md -d 2 -x "pandoc --toc -s test.md -o test.html"

To-do

  • Implement a correct argument parser
  • Implement correct error handling
Comments
  • Add sub 1 second delay option

    Add sub 1 second delay option

    Issue: Feature request


    TLDR:

    Allow the user to use a delay of less than one second.

    Description of the request

    Some usage would require to check if the watched file has been changed in a shorter time frame than one second.

    Thus, it would be beneficial to allow the user to input a delay value with more precision.

    Thoughts around the implementation

    One could specify the unit of the delay like this

    • -d 1s = 1 second delay
    • -d 100ms = 100 millisecond delay
    feature request 
    opened by arxaqapi 1
  • Road to v0.2.0

    Road to v0.2.0

    This pull request acts as a To-Do list to monitor the changes for the upcoming v0.2 release.

    • [x] Add the possibility to watch for modification in directories (see #5)
      • [x] Make it possible to restrain the maximum depth to look for changes in directories
      • [x] ~Parse the given .gitignore files to specify which file to ignore ?~ Postponed
    • [x] Cleanup the code and make it more readable
    opened by arxaqapi 0
  • Watch a complete directory for change

    Watch a complete directory for change

    Add the possibility to monitor for changes in a entire directory.

    • ~.gitignore files should be parsed and taken into account by default, thus not monitoring large or numerous useless files~ Postponed
    • ojo .: The current directory . can be used to monitor files in the current directory
    feature request 
    opened by arxaqapi 0
  • protected path causes Unix.lstat to fail

    protected path causes Unix.lstat to fail

    Description

    ojo fails if Unix.lstat fails. If the permission are denied the stats cannot be retrieved.

    Error gotten if watching root /:

    Fatal error: exception Sys_error("//lost+found: Permission denied")
    

    What should happen instead

    The protected path (file or directory) should be ignored and not cause ojo to crash

    bug 
    opened by arxaqapi 0
  • hardcoded user path in tests causes errors

    hardcoded user path in tests causes errors

    The line:

      let _dir = Watcher.Dir.make ~max_depth:1 "/home/aq" in
    

    Causes opam-CI to fail when trying to call Unix.lstat on /home/aq.

    See: https://opam.ci.ocaml.org/github/ocaml/opam-repository/commit/0ea05c11e1c99d3a3a7d44edbfcbed19a245061c

    opened by arxaqapi 0
Releases(v0.2.0)
  • v0.2.0(Dec 26, 2022)

    • Directories 🗂️ can now be monitored for change!
    • The --depth parameter has been added to control the maximum depth used to monitor files.

    What's Changed

    • Road to v0.2.0 by @arxaqapi in https://github.com/arxaqapi/ojo/pull/7

    Full Changelog: https://github.com/arxaqapi/ojo/compare/v0.1.1...v0.2.0

    Source code(tar.gz)
    Source code(zip)
  • v0.1.1(Dec 22, 2022)

    1. Small minor corrections in the config files.
    2. Addition to Opam 🐫 is pending.

    What's Changed

    • V0.1.1 by @arxaqapi in https://github.com/arxaqapi/ojo/pull/6

    Full Changelog: https://github.com/arxaqapi/ojo/compare/v0.1.0...v0.1.1

    Source code(tar.gz)
    Source code(zip)
  • v0.1.0(Dec 2, 2022)

    ✨ First release!

    • Only one file can be watched at a time currently

    What's Changed

    • Road to v0.1.0 by @arxaqapi in https://github.com/arxaqapi/ojo/pull/4
    Source code(tar.gz)
    Source code(zip)
Owner
Tarek Kunze
Master's CS student
Tarek Kunze
A CLI screentime monitoring tool. Shows how much time are you using certain apps.

A screentime monitoring tool, shows how much time are you really using certain apps. It work nicely with i3status or py3status on I3 window manager fo

Piotr Czajka 6 Dec 8, 2022
Just provide a macro for a certain programming language.

Trust me, this is safe! A macro wrap unsafe keyword into safe! macro. Always trust programmers. use std::alloc::{alloc, dealloc, Layout}; use trust_m

null 4 Dec 13, 2023
An Rust implementation of the Modified Merkle Patricia Tree described by ETH Yellow Paper

Merkle Patricia Tree的Rust实现 博客文章:https://dere.press/2022/01/24/eth-trie/ 本实现参考下列项目: https://ethereum.github.io/yellowpaper/paper.pdf https://github.co

M4tsuri 3 Dec 13, 2022
A simple crate, that protects some variables from being modified by memory tampering tools.

Crate: protected_integer A simple crate, that protects some variables from being modified by memory tampering tools. Usage Add this crate to dependenc

lihe 5 Nov 30, 2022
Run a program with a modified process name.

tagrun Run a program with a modified process name. You can add a tag for a process with tagrun, and use the tag to locate the process with ps, pgrep o

Li 2 Dec 21, 2022
CLI tool that make it easier to perform multiple lighthouse runs towards a single target and output the result in a plotable format.

Lighthouse Aggregator CLI tool that make it easier to perform multiple lighthouse runs towards a single target and output the result in a "plotable" f

Polestar 1 Jan 12, 2022
A very simple third-party cargo subcommand to execute a custom command

cargo-x A very simple third-party cargo subcommand to execute a custom command Usage install cargo-x cargo install cargo-x or upgrade cargo install -

刘冲 9 Dec 26, 2022
A command-line tool aiming to upload the local image used in your markdown file to the GitHub repo and replace the local file path with the returned URL.

Pup A command line tool aiming to upload the local image used in your markdown file to the GitHub repo and replace the local file path with the return

SteveLau 11 Aug 17, 2022
Wraps cargo to move target directories to a central location [super experimental]

targo Wraps cargo to move target directories to a central location [super experimental] To use, cargo install --git https://github.com/sunshowers/targ

Rain 18 Jan 7, 2023
Execute Javascript code in the Dioxus, and get the return value ( for Dioxus )

Golde Dioxus Execute Javascript code in the Dioxus, and get the return value. This demo can help use Javascript to calc the + operator formula. use di

YuKun Liu 15 Dec 27, 2022
Workflows make it easy to browse, search, execute and share commands (or a series of commands)--without needing to leave your terminal.

Workflows The repo for all public Workflows that appear within Warp and within commands.dev. To learn how to create local or repository workflows, see

Warp 369 Jan 2, 2023
Workflows make it easy to browse, search, execute and share commands (or a series of commands)--without needing to leave your terminal.

Workflows The repo for all public Workflows that appear within Warp and within commands.dev. To learn how to create local or repository workflows, see

Warp 227 Jun 1, 2022
Abuse the node.js inspector mechanism in order to force any node.js/electron/v8 based process to execute arbitrary javascript code.

jscythe abuses the node.js inspector mechanism in order to force any node.js/electron/v8 based process to execute arbitrary javascript code, even if t

Simone Margaritelli 301 Jan 4, 2023
Execute Rust code carefully, with extra checking along the way

cargo-careful cargo careful is a tool to run your Rust code extra carefully -- opting into a bunch of nightly-only extra checks that help detect Undef

Ralf Jung 240 Dec 28, 2022
scan markdown files and execute `console` blocks

exec-commands − scan markdown files and execute console blocks exec-commands is a utility to update command-line-tool examples embedded in markdown fi

Hajime Suzuki 3 Nov 27, 2022
Execute KDL files!

kdl-script A Compiler for KDLScript, the KDL-based programming language! KDLScript is a "fake" scripting language that actually just exists to declare

Aria Beingessner 21 Dec 23, 2022
A rust library that allows you to host the CLR and execute dotnet binaries.

ClrOxide ClrOxide is a rust library that allows you to host the CLR and dynamically execute dotnet binaries. I wanted to call it Kepler for no particu

YK 94 Apr 12, 2023
A tool for determining file types, an alternative to file

file-rs a tool for determining file types, an alternative to file whats done determining file extension determining file type determining file's mime

null 3 Nov 27, 2022