Skip to content

Commit 6ea9f70

Browse files
committed
Make auto_refresh, tag debug extensions noops when not in dev mode
1 parent 2e5fe62 commit 6ea9f70

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

bin/syntropy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ rescue StandardError => e
7070
exit
7171
end
7272

73+
$syntropy_dev_mode = env[:dev_mode]
7374
env[:root_dir] = (ARGV.shift || '.').gsub(/\/$/, '')
7475

7576
if !File.directory?(env[:root_dir])

lib/syntropy/papercraft_extensions.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@
44

55
Papercraft.extension(
66
'auto_refresh_watch!': ->(loc = '/.syntropy') {
7-
script(src: File.join(loc, 'auto_refresh/watch.js'), type: 'module')
7+
if $syntropy_dev_mode
8+
script(src: File.join(loc, 'auto_refresh/watch.js'), type: 'module')
9+
end
810
},
911
'debug_template!': ->(loc = '/.syntropy') {
10-
script(src: File.join(loc, 'debug/debug.js'), type: 'module')
12+
if $syntropy_dev_mode
13+
script(src: File.join(loc, 'debug/debug.js'), type: 'module')
14+
end
1115
}
1216
)

0 commit comments

Comments
 (0)