Ind.ie is now Small Technology Foundation.
Commit 6ad29a5f authored by Aral Balkan's avatar Aral Balkan

Don’t watch old content and themes folders

parent efb9d550
Pipeline #869 canceled with stages
......@@ -389,7 +389,7 @@ class Blockdown
(globAsync "#{contentPath}/**/*.md", {})
.series (file) =>
# @log.info "Reading blockdown file: #{file}"
@log.info "Reading blockdown file: #{file}"
#
# Check cache
......@@ -398,12 +398,13 @@ class Blockdown
parsedFilePath = (path.parse file)
# console.log(parsedFilePath)
# On development, the cache folder is at /users/<name>/better.fyi/.private/cache/…
# In production, it is accessed via /app/better.fyi/.private/cache/…
# The cache folder is at /users/<name>/better.fyi/.private/cache/…
# So choose the start index of the file path accordingly.
indexToStartFrom = if app.isRunningInProduction then 4 else 5
indexToStartFrom = 7
filePathKey = path.join parsedFilePath.dir.split('/')[indexToStartFrom..].join('/'), parsedFilePath.base
console.log(filePathKey)
# console.log(filePathKey)
# @log.info "File path key: #{filePathKey}"
......@@ -411,7 +412,7 @@ class Blockdown
# @log.info "Previous: #{@contentPreviousModifiedTimes[filePathKey]}"
if @contentCurrentModifiedTimes[filePathKey] == @contentPreviousModifiedTimes[filePathKey]
################################################################################
#
# Use cache.
......@@ -451,7 +452,7 @@ class Blockdown
indexInfo = fs.readJsonSync indexInfoJSONFilePath
indexContent[indexInfo.category][indexInfo.titleOfPageClean] = indexInfo.listItem
else
console.log "\t⚠ Could not find index info JSON from path #{indexInfoJSONFilePath}. Ignoring…"
console.log "\t⚠ Could not find index info JSON from path #{indexInfoJSONFilePath}. Ignoring…"
# Break out so we don’t fall through a fresh render.
return
......
......@@ -63,7 +63,7 @@ class Builder
# If the app is running in development, fire off a
# notification to let people know that rendering is done.
exec "osascript -e 'display notification \"♥ Ready\" with title \"Better\" sound name \"Ping\"'"
# exec "osascript -e 'display notification \"♥ Ready\" with title \"Better\" sound name \"Ping\"'"
# Touch a file to signal that the build is complete.
# (Used by the installer on the first run to know
......@@ -73,7 +73,7 @@ class Builder
.catch (e) =>
# If the app is running in development, fire off a
# notification to let people know that rendering is done.
exec "osascript -e 'display notification \"✗ Error\" with title \"Better\" sound name \"Basso\"'"
# exec "osascript -e 'display notification \"✗ Error\" with title \"Better\" sound name \"Basso\"'"
@log.error "Build error.\n\n#{e}"
console.trace()
......@@ -85,6 +85,7 @@ class Builder
updateCache: =>
Promise.try =>
(new Cache).build()
.then => console.log('Updated cache.')
#
# Render content in Blockdown format.
......
......@@ -86,7 +86,7 @@ class Cache
# On production the route to the data folders has one fewer level.
# Take that into account when creating the cache.
indexToStartFrom = if app.isRunningInProduction then 4 else 5
indexToStartFrom = if app.isRunningInProduction then 4 else 6
filePathFragment = fileComponents[indexToStartFrom..].join '/'
# Using the sync version of stat is a little faster here
......
......@@ -5,7 +5,7 @@ site dist &
SITE_JS_PID=$!
# Start Blockdown Builder
nodemon -e coffee,litcoffee,js,html,md,css,svg,png,jpg,json,safariextz,plist --watch ~/better.fyi/themes --watch ~/better.fyi/content --watch . Main.coffee
nodemon -e coffee,litcoffee,js,html,md,css,svg,png,jpg,json,safariextz,plist --watch . Main.coffee
# On exit, kill the Site.js background process.
kill $SITE_JS_PID
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment