Skip to content

Instantly share code, notes, and snippets.

@jqtrde
Last active August 29, 2015 14:02
Show Gist options
  • Save jqtrde/6fb6cdf71a28fe51c727 to your computer and use it in GitHub Desktop.
Save jqtrde/6fb6cdf71a28fe51c727 to your computer and use it in GitHub Desktop.
How to get watchman and make to play together.
id longitude latitude name
1 -67.727002 44.949998 One
2 -68.056075 45.031446 Two
Display the source blob
Display the rendered blob
Raw
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {
"id": "1",
"name": "One"
},
"geometry": {
"type": "Point",
"coordinates": [
-67.727002,
44.949998
]
}
},
{
"type": "Feature",
"properties": {
"id": "2",
"name": "Two"
},
"geometry": {
"type": "Point",
"coordinates": [
-68.056075,
45.031446
]
}
}
]
}
from subprocess import call
def make():
call(['make'])
if __name__ == '__main__':
make()
all: \
i.geojson
# create geojson from csv
i.geojson: i.csv
csv2geojson $< > $@
watch:
watchman watch $(shell pwd)
watchman -- trigger $(shell pwd) rebuild '*.csv' -- python $(shell pwd)/make.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment