瀏覽代碼

fix example creation server-side

Benoît Hubert 8 年之前
父節點
當前提交
09e15563c2

+ 2 - 2
sandboxApp.js

@@ -180,9 +180,9 @@ app.post('/:repoSlug/examples',
     }, exampleTmpl);
 
     // Prepare files to write
-    var targetDir = __dirname + '/exemples/' + repoSlug + '/' + exampleSlug;
+    var targetDir = examplesDir + '/' + repoSlug + '/' + exampleSlug;
     var files = mapObjToArray({
-      'example.html': '<!-- ' + title + '-->\n',
+      'example.html': '<!-- ' + title + ' -->\n',
       'script.js': '// ' + title,
       'config.json': beautify(config, null, 2, 100)
     }, 'file', 'content');

+ 1 - 0
test/integration/test-examples/example-repo1/repo-config.json

@@ -1,5 +1,6 @@
 {
   "title": "Example Repo 1",
+  "defaultCategory": "test-stuff",
   "categories": [
     {
       "slug": "test-stuff",

+ 1 - 0
test/integration/test-examples/example-repo2/repo-config.json

@@ -1,5 +1,6 @@
 {
   "title": "Example Repo 2",
+  "defaultCategory": "random-stuff",
   "categories": [
     {
       "slug": "random-stuff",