-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates the readme file with some docs Adds a proper license
- Loading branch information
Showing
5 changed files
with
229 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,22 @@ | ||
# LICENSE | ||
|
||
The MIT License | ||
|
||
Copyright (c) 2016 Wesley Cope http://wess.io | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ all: build | |
build: | ||
@swift build | ||
|
||
install: release | ||
install: | ||
@mv .build/release/overlook /usr/local/bin/ | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,127 @@ | ||
# Overlook | ||
# Overlook ![Swift](http://img.shields.io/badge/swift-3.0-brightgreen.svg) | ||
|
||
A commandline app that will watch your folder and monitor any changes. When a change occurs, *Overlook* will execute (or restart) the process. *Overlook* is platform | ||
independent and will work with anything from writing a README file, to developing a service. | ||
|
||
--- | ||
|
||
### Table of Contents | ||
|
||
* [Requirements](#requirements) | ||
* [Installation](#installation) | ||
* [Homebrew](#homebrew) | ||
* [Via Script](#via-script) | ||
* [Manual](#manual) | ||
* [Usage](#usage) | ||
* [.overlook](#.overlook) | ||
* [Commandline](#commandline) | ||
* [To Do](#to-do) | ||
* [Contributing](#contributing) | ||
* [License](#license) | ||
|
||
|
||
--- | ||
# Requirements | ||
- Swift 3.0 or up. | ||
|
||
# Installation | ||
## Homebrew | ||
```bash | ||
brew install wess/repo/overlook --HEAD | ||
``` | ||
|
||
## Via Script | ||
```bash | ||
curl -sL wess.io/overlook/install.sh | ||
``` | ||
|
||
## Build It Yourself | ||
```bash | ||
git clone https://github.com/wess/overlook.git | ||
cd overlook | ||
make release | ||
ln -s .build/release/overlook /usr/local/bin/overlook | ||
``` | ||
|
||
# Usage | ||
There are 2 ways to use *Overlook*. You can either use it completely on the command line, or setup a _.overlook_ config file. | ||
|
||
## .overlook | ||
The _.overlook_ file is a configuration file that defines environment variables, what to ignore, what to watch and what to excute on change. To create a _.overlook_ file in your current directory, simply run: | ||
|
||
```bash | ||
$ overlook init | ||
``` | ||
|
||
This will generate the following file: | ||
|
||
```json | ||
{ | ||
"ignore" : [ | ||
".git", | ||
".gitignore", | ||
".overlook" | ||
], | ||
"env" : { | ||
"example" : "variable" | ||
}, | ||
"execute" : [ | ||
"ls -la" | ||
], | ||
"directories" : [ | ||
"build", | ||
"tests" | ||
] | ||
} | ||
``` | ||
|
||
*Available* | ||
- _*ignore*_ : A list of files or folders that Overlook should ignore changes on. | ||
|
||
- _*env*_ : Environment variables _overlook_ can set for you when running/restarting. | ||
|
||
- _*execute*_ : A list of commands for _overlook_ to run when a change has been observed. | ||
|
||
- _*directories*_ : Directories that should be watched for changes. | ||
|
||
--- | ||
|
||
## Commandline | ||
Overlook can run without a _.overlook_ file. You can run ```overlook help``` for a list of available commands | ||
|
||
The main command you will use with _overlook_ will be _watch_. This command is what tells _overlook_ what to watch for changes and what to execute. | ||
|
||
The required flags for _overlook watch_ are: | ||
- *e, execute* What is executed when targets are changed. | ||
|
||
- *h, help* Show help information for this command. | ||
|
||
|
||
|
||
|
||
- *i, ignore* Comma separated list of files or directories to ignore. | ||
|
||
- *t, target* Comma separated list of directory or files to monitor. | ||
|
||
|
||
Example: | ||
|
||
```bash | ||
$ overlook watch -t /folder/to/watch -e /script/to/execute | ||
``` | ||
|
||
# To Do | ||
- Parallel observations/executions | ||
- Task running | ||
|
||
# Contributing | ||
Contributions are welcome, just make a pull request. If you are including new functionality, please write a usage example, and include any information that will impact installation and/or setup. | ||
|
||
# License | ||
*Overlook* is released under the MIT license. See LICENSE for details. | ||
|
||
# Get in touch | ||
- Any questions, comments, concerns? Hit me up on twitter: [@wesscope](https://twitter.com/wesscope) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/bash | ||
|
||
SWIFTC=`which swift` | ||
SWIFTV=`swift --version` | ||
OS=`uname` | ||
|
||
if [[ $SWIFTC == "" ]]; | ||
then | ||
echo "❌ Unable to locate a swift installation." | ||
echo "" | ||
echo "Swift 3 is required to install Overlook." | ||
echo "For more information on Swift, visit Swift.org" | ||
echo "" | ||
exit 1; | ||
fi | ||
|
||
if [[ $OS == "Darwin" ]]; # macOS | ||
then | ||
XCBVERSION=`xcodebuild -version` | ||
if [[ $XCBVERSION != *"Xcode 8"* ]]; | ||
then | ||
echo "⚠️ It looks like your Command Line Tools version is incorrect." | ||
echo "" | ||
echo "Open Xcode and make sure the correct SDK is selected:" | ||
echo "👀 Xcode > Preferences > Locations > Command Line Tools" | ||
echo "" | ||
echo "Correct: Xcode 8.x (Any Build Number)" | ||
echo "Current: $XCBVERSION" | ||
echo "" | ||
help | ||
exit 1; | ||
fi | ||
fi | ||
|
||
if [[ $SWIFTV == *"3.0"* ]]; | ||
then | ||
echo "✅ Compatible" | ||
exit 0; | ||
else | ||
echo "❌ Incompatible" | ||
echo "Reason: Swift 3.0 is required." | ||
echo "" | ||
echo "'swift --version' output:" | ||
echo $SWIFTV | ||
echo "" | ||
echo "Output does not contain '3.0'." | ||
echo "" | ||
help | ||
exit 1; | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
curl -sL "wess.io/overlook/check.sh" | bash || exit 1; | ||
|
||
DIR=".overlook-tmp"; | ||
BOLD=$(tput bold) | ||
NORMAL=$(tput sgr0) | ||
|
||
rm -rf $DIR; | ||
mkdir -p $DIR | ||
cd $DIR; | ||
|
||
echo "Downloading..."; | ||
git clone https://github.com/wess/overlook.git overlook > /dev/null 2>&1; | ||
cd overlook | ||
|
||
echo "Compiling..."; | ||
make clean; | ||
make release; | ||
|
||
echo "Installing..."; | ||
make install; | ||
|
||
cd ../../; | ||
rm -rf $DIR; | ||
|
||
echo "Complete. Use: ${BOLD}overlook help${NORMAL} and ${BOLD}overlook <command> help{$NORMAL} for more info."; | ||
|
||
|