Explorar el Código

Prevent empty layout configs

Kevin van Zonneveld hace 9 años
padre
commit
e1096d4c0c
Se han modificado 1 ficheros con 6 adiciones y 1 borrados
  1. 6 1
      website/update.js

+ 6 - 1
website/update.js

@@ -7,11 +7,16 @@ var uppyRoot = path.dirname(__dirname)
 
 var configPath = webRoot + '/themes/uppy/_config.yml'
 var version = require(uppyRoot + '/package.json').version
+var configTemplate = '# Uppy versions, auto updated by update.js\nuppy_version: 0.0.1\n\nuppy_dev_size: "0.0"\nuppy_min_size: "0.0"\nuppy_gz_size: "0.0"'
 var config
 try {
   config = fs.readFileSync(configPath, 'utf-8')
 } catch (e) {
-  config = '# Uppy versions, auto updated by update.js\nuppy_version: 0.0.1\n\nuppy_dev_size: "0.0"\nuppy_min_size: "0.0"\nuppy_gz_size: "0.0"'
+
+}
+
+if (!config || !config.trim()) {
+  config = configTemplate
 }
 
 // Inject current Uppy version and sizes in website's _config.yml