Skip to content

Commit 9f17856

Browse files
authored
Merge pull request #25 from fastruby/fbuys/24-copy-gemfile-lock-file
Copy Gemfile.lock on `--init`
2 parents f6161f0 + 2afde42 commit 9f17856

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Right now, the path to the shitlist is hardcoded so make sure you store yours at
8383
This command helps you dual-boot your application.
8484

8585
```bash
86-
next --init # Create Gemfile.next
86+
next --init # Create Gemfile.next and Gemfile.next.lock
8787
vim Gemfile # Tweak your dependencies conditionally using `next?`
8888
next bundle install # Install new gems
8989
next rails s # Start server using Gemfile.next
@@ -105,6 +105,17 @@ Or install it yourself as:
105105

106106
$ gem install next_rails
107107

108+
## Setup
109+
110+
Execute:
111+
112+
$ next --init
113+
114+
Init will create a Gemfile.next and an initialized Gemfile.next.lock.
115+
The Gemfile.next.lock is initialized with the contents of your existing
116+
Gemfile.lock lock file. We initialize the Gemfile.next.lock to prevent
117+
major version jumps when running the next version of Rails.
118+
108119
## License
109120

110121
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).

exe/next.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@ STRING
1010
mv Gemfile.tmp Gemfile
1111

1212
ln -s Gemfile Gemfile.next
13+
14+
# Initialize the Gemfile.next.lock
15+
# Prevents major version jumps when we start without a Gemfile.next.lock
16+
if [ -f "Gemfile.lock" ] && [ ! -f "Gemfile.next.lock" ]; then
17+
cp Gemfile.lock Gemfile.next.lock
18+
fi
19+
1320
echo <<-MESSAGE
1421
Created Gemfile.next (a symlink to your Gemfile). Your Gemfile has been modified to support dual-booting!
1522

0 commit comments

Comments
 (0)