If you want to sync a Floobits workspace without using an editor, there’s Floomatic. Floomatic keeps a directory on your computer in sync with a Floobits workspace. Use it to:

  • Create a new workspace from files on disk.
  • Sync changes to a remote development server.
  • Sync changes from your local computer. (If you don't have a compatible editor.)
  • Automatically perform an action when files are saved; see hooks.

Initial set-up

Floomatic requires Node.js.

Floomatic uses the credentials in your ~/.floorc.json. If you’ve used a Floobits plugin on the system, you’re all set.

Optional Dependencies

To sync binary files, Floomatic requires Qt 4.x. To meet this dependency, mac users with homebrew can brew install qt. Ubuntu users can apt-get install libqt4-dev. Without Qt, floomatic may corrupt binary files.

During the install, non-mac users will see a warning about fsevents failing to build. Don’t worry about it. Only OS X users need the fsevents dependency.

Installation

~$ npm install -g floomatic /usr/local/bin/floomatic -> /usr/local/lib/node_modules/floomatic/bin/floomatic ... ~$

Usage

Share a directory (create a public workspace)

~$ floomatic --share ~/code/agtest ▪️ LOG 2017-01-08 15:34:46 PST Created workspace https://floobits.com/ggreer/agtest ▪️ LOG 2017-01-08 15:34:46 PST Joining workspace https://floobits.com/ggreer/agtest ▪️ LOG 2017-01-08 15:34:46 PST Reloading hooks. ▪️ LOG 2017-01-08 15:34:46 PST Didn't find any hooks in .floo. ▪️ LOG 2017-01-08 15:34:46 PST Watching /Users/ggreer/code/ag_bench/.floo for changes ▪️ LOG 2017-01-08 15:34:48 PST starting syncing ... ▪️ LOG 2017-01-08 15:34:48 PST buf the_silver_searcher.spec.in doesn't exist. creating... ▪️ LOG 2017-01-08 15:34:48 PST all done syncing ▪️ LOG 2017-01-08 15:34:48 PST Opening browser to https://floobits.com/ggreer/agtest

Join a workspace

~/code/workspace_name$ floomatic --join https://floobits.com/owner_name/workspace_name ▪️ LOG 2017-01-08 15:41:37 PST Joining workspace https://floobits.com/owner_name/workspace_name ▪️ LOG 2017-01-08 15:41:37 PST Reloading hooks. ▪️ LOG 2017-01-08 15:41:37 PST Watching /Users/ggreer/code/workspace_name/.floo for changes ▪️ LOG 2017-01-08 15:41:38 PST starting syncing ... ▪️ LOG 2017-01-08 15:41:38 PST all done syncing ▪️ LOG 2017-01-08 15:41:38 PST Opening browser to https://floobits.com/owner_name/workspace_name

If you don't want to ship local changes to the Floobits server, use --read-only

You can see a full list of options by running floomatic -h:

~$ floomatic -h floomatic version 0.5.4 Usage: /usr/local/bin/floomatic --join [url] --share [url] --read-only --verbose [path_to_sync] Options: --join The URL of the workspace to join (cannot be used with --share). [string] [default: undefined] --share Creates a new workspace if possible. Otherwise, it will sync local files to the existing workspace. [default: false] -w The Floobits Workspace. [default: "django-stuff"] -o The owner of the Workspace. Defaults to the .floo file's owner or your ~/.floorc username. [default: "Floobits"] --read-only Don't send patches for local modifications. -H Host to connect to. For debugging/development. Defaults to floobits.com. [required] [default: "floobits.com"] -p Port to use. For debugging/development. Defaults to 3448. [required] [default: 3448] --verbose Enable debugging output. --version Print version. --no-browser Don't try to open the web editor (--read-only mode also enables this) ~$

Hooks

Floomatic can run hooks when you save files in the workspace. Presently, only the Floobits Sublime Plugin and the Web Editor emit saved events. Hooks are stored in the workspace's .floo file and should generally use absolute paths. Here’s what an example .floo file looks like:

{
    "url": "https://floobits.com/Floobits/website/",
    "hooks": {
        "*.js": "cd /path/to/django && ./manage.py compress --force",
        "*.py": "touch /path/to/django/django.wsgi",
        "*.less": "/web/regenerate_less.sh",
        "*": "echo #FLOO_HOOK_FILE"
    }
}

Floomatic will replace the string #FLOO_HOOK_FILE with the absolute path of the file that triggered the hook.