Skip to content

Commit dc0b603

Browse files
authored
Add missing bun.lock checks to copy text-based lockfile (#139)
* Add missing bun.lock checks to copy text-base lockfile * Default to .lock
1 parent 104f1fa commit dc0b603

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

lib/generators/dockerfile_generator.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1255,7 +1255,7 @@ def api_client_files
12551255
client = api_client_dir
12561256
return unless client
12571257

1258-
Dir["#{client}/{package.json,package-lock.json,yarn.lock,bun.lockb}"]
1258+
Dir["#{client}/{package.json,package-lock.json,yarn.lock,bun.lockb,bun.lock}"]
12591259
end
12601260

12611261
def dbprep_command

lib/generators/templates/Dockerfile.erb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,15 @@ FROM base AS <%= parallel? ? 'pre' : '' %>build
7070
FROM prebuild AS <% if using_bun? %>bun<% else %>node<% end %>
7171

7272
<% end -%>
73-
<% if using_bun? and (!using_execjs? || File.exist?('bun.lockb')) -%>
73+
<% if using_bun? and (!using_execjs? || File.exist?('bun.lockb') || File.exist?('bun.lock')) -%>
7474
<%= render partial: 'install_node', locals: {bun_version: using_execjs? ? nil : bun_version} %>
7575

7676
<% elsif using_node? and (!using_execjs? || File.exist?('yarn.lock')) -%>
7777
<%= render partial: 'install_node', locals: {node_version: using_execjs? ? nil : node_version, yarn_version: File.exist?('yarn.lock') ? yarn_version : nil} %>
7878

7979
<% end -%>
8080
<% if parallel? -%>
81-
<%= render partial: 'npm_install', locals: {sources: Dir[*%w(package.json yarn.lock bun.lockb)]} %>
81+
<%= render partial: 'npm_install', locals: {sources: Dir[*%w(package.json yarn.lock bun.lockb bun.lock)]} %>
8282

8383

8484
FROM prebuild AS build
@@ -149,7 +149,7 @@ ENV PATH=/usr/local/node/bin:$PATH
149149
<% end -%>
150150

151151
<% elsif using_node? || using_bun? -%>
152-
<%= render partial: 'npm_install', locals: {sources: Dir[*%w(.npmrc .yarnrc package.json package-lock.json yarn.lock bun.lockb)]} %>
152+
<%= render partial: 'npm_install', locals: {sources: Dir[*%w(.npmrc .yarnrc package.json package-lock.json yarn.lock bun.lockb bun.lock)]} %>
153153

154154
<% end -%>
155155
# Copy application code

test/results/bun/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ RUN bundle install && \
5151
bundle exec bootsnap precompile --gemfile
5252

5353
# Install node modules
54-
COPY package.json bun.lockb ./
54+
COPY package.json bun.lock ./
5555
RUN bun install --frozen-lockfile
5656

5757
# Copy application code

0 commit comments

Comments
 (0)