Git Product home page Git Product logo

fsblock's Introduction

FSBlock

Simple .NET Core command line utility for performing actions on filesystem changes. It can either call commands (batch file, shell script, etc) on file change or simply block the command line from executing until a file changes.

Building

Use dotnet publish -c release -r <platform-name> to build a self-contained deployment for your platform. Alternatively, simply build with dotnet build and run the resulting binary with dotnet fsblock.dll. Alternatively, use dotnet-warp to build a completely self-contained executable.

Usage Examples

Basic

fsblock.exe -p "src" -w -C "rebuild.bat" -F

The above usage sample calls rebuild.bat (-C "rebuild.bat") any time a file changes within the src/ folder (-p "src"). It passes the filename as the first argument to the batch file (-F). The -w flag causes it to run continuously rather than simply blocking.

Interactive coding in C/C++

@echo off
echo Press Ctrl+C to exit.

:loop
fsblock.exe -p "src"
pushd build/Ninja
ninja

IF %ERRORLEVEL% NEQ 0 (
    call resulting_executable.exe
) else (
    echo Ninja build failed, error is above
)

popd
goto loop

The above is a batch file that watches for changes and, if a change occurs, rebuilds with Ninja. It is a very basic example for live coding, which was the original intent of this project.

Command Line Options

Call fsblock.exe with the following options

-n, --norecurse     Specifies that the watch should be non-recursive

-v, --verbose       Verbose mode

-w, --watch           If feedback is disabled and no commands are set to run, this will appear to do nothing.

-f, --nofeedback    Specifies whether or not to print changes to stdout

-p, --path          Required. Specifies the directory to watch

-C, --command       Specifies a command to run from the current shell environment when a file changes.

-F, --forward       Specifies whether or not to forward modified file name to command line on changes.  Only has an effect if --command is set.

-N, --nocmdwait     Do not wait for command to finish.  Only has an effect if --command is set.

-i, --ignore        Set of paths to ignore

fsblock's People

Contributors

shadowndacorner avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.