Skip to content

Commit

Permalink
Merge pull request #25 from fastruby/fbuys/24-copy-gemfile-lock-file
Browse files Browse the repository at this point in the history
Copy Gemfile.lock on `--init`
  • Loading branch information
etagwerker authored Oct 23, 2021
2 parents f6161f0 + 2afde42 commit 9f17856
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Right now, the path to the shitlist is hardcoded so make sure you store yours at
This command helps you dual-boot your application.

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

$ gem install next_rails

## Setup

Execute:

$ next --init

Init will create a Gemfile.next and an initialized Gemfile.next.lock.
The Gemfile.next.lock is initialized with the contents of your existing
Gemfile.lock lock file. We initialize the Gemfile.next.lock to prevent
major version jumps when running the next version of Rails.

## License

The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
7 changes: 7 additions & 0 deletions exe/next.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ STRING
mv Gemfile.tmp Gemfile

ln -s Gemfile Gemfile.next

# Initialize the Gemfile.next.lock
# Prevents major version jumps when we start without a Gemfile.next.lock
if [ -f "Gemfile.lock" ] && [ ! -f "Gemfile.next.lock" ]; then
cp Gemfile.lock Gemfile.next.lock
fi

echo <<-MESSAGE
Created Gemfile.next (a symlink to your Gemfile). Your Gemfile has been modified to support dual-booting!
Expand Down

0 comments on commit 9f17856

Please sign in to comment.