Skip to content

Commit 4bb2854

Browse files
authored
Fix cp update none on Heroku 20 (heroku#1586)
* Fix `cp` update none on Heroku 20 In heroku#1583 a warning was bypassed by switching from `-n` to `--update none`. Unfortunately this triggers an error with the version of `cp` on `heroku-20` (which is EOL in 2 days) due to not having that flag: ``` -----> Preparing app for Rails asset pipeline remote: cp: option '--update' doesn't allow an argument remote: Try 'cp --help' for more information. ``` Internal ticket link https://heroku.support/1570694. * Check exit status of copy command * Changelog
1 parent 22848b9 commit 4bb2854

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
## [Unreleased]
44

5+
- Fix `cp --update=none` on `heroku-20` (https://github.com/heroku/heroku-buildpack-ruby/pull/1586)
56

67
## [v303] - 2025-04-25
78

89
- Ruby 3.5.0-preview1 is now available
9-
1010
- Fix warning message about `cp -n` (https://github.com/heroku/heroku-buildpack-ruby/pull/1583)
1111

1212
## [v302] - 2025-04-16

lib/language_pack/cache.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,12 @@ def load_without_overwrite(path, dest=nil)
5858
return unless @cache_base
5959

6060
dest ||= path
61-
copy (@cache_base + path), dest, '-a --update=none'
61+
62+
if ENV["STACK"] == "heroku-20"
63+
copy (@cache_base + path), dest, "-a -n"
64+
else
65+
copy (@cache_base + path), dest, "-a --update=none"
66+
end
6267
end
6368

6469
# copy cache contents
@@ -69,7 +74,9 @@ def copy(from, to, options='-a')
6974

7075
return false unless File.exist?(from)
7176
FileUtils.mkdir_p File.dirname(to)
72-
system("cp #{options} #{from}/. #{to}")
77+
command = "cp #{options} #{from}/. #{to}"
78+
system(command)
79+
raise "Command failed `#{command}`" unless $?
7380
end
7481

7582
# copy contents between to places in the cache

0 commit comments

Comments
 (0)