From 013b4a8394e00792649936a78ce49680898da899 Mon Sep 17 00:00:00 2001 From: yterajima Date: Thu, 7 May 2015 21:19:30 +0900 Subject: [PATCH] fixed: Builded text file(html, css, xml, txt...)'s permission is 0600 In v3-stable branch, builded text file's permission are 0644. But in master(v4) branch, file's permission are 0600. When I deploy(drug-and-drop with sftp), the website isn't displayed. So I fixed this problem. --- middleman-core/features/builder.feature | 10 +++++++++- middleman-core/lib/middleman-core/builder.rb | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/middleman-core/features/builder.feature b/middleman-core/features/builder.feature index 92e4310d..b61f5cdc 100644 --- a/middleman-core/features/builder.feature +++ b/middleman-core/features/builder.feature @@ -46,4 +46,12 @@ Feature: Builder Scenario: Build alias (b) Given a fixture app "large-build-app" When I run `middleman b` - Then was successfully built \ No newline at end of file + Then was successfully built + + Scenario: Builded text file(ex: html, css, xml, txt)'s permission is 0644 + Given a successfully built app at "large-build-app" + When I cd to "build" + Then the mode of filesystem object "index.html" should match "0644" + And the mode of filesystem object "stylesheets/static.css" should match "0644" + And the mode of filesystem object "feed.xml" should match "0644" + And the mode of filesystem object ".htaccess" should match "0644" diff --git a/middleman-core/lib/middleman-core/builder.rb b/middleman-core/lib/middleman-core/builder.rb index da2bea06..0d0966c4 100644 --- a/middleman-core/lib/middleman-core/builder.rb +++ b/middleman-core/lib/middleman-core/builder.rb @@ -130,6 +130,7 @@ module Middleman file.binmode file.write(contents) file.close + File.chmod(0644, file) file end