mirror of
https://github.com/TracksApp/tracks.git
synced 2025-09-22 05:50:47 +02:00
Remove the Rails dependency on host by fixing the bin/ra[ke,ils] scripts to use basic sh
This commit is contained in:
parent
bb2bcd7245
commit
d9e20e6d12
4 changed files with 35 additions and 14 deletions
19
bin/rails
19
bin/rails
|
@ -1,8 +1,13 @@
|
|||
#!/usr/bin/env ruby
|
||||
if File.exist?("#{__dir__}/../.use-docker")
|
||||
exec("#{__dir__}/../script/docker-environment", $PROGRAM_NAME, *ARGV) unless File.exist?("/etc/app-env")
|
||||
end
|
||||
#!/bin/sh
|
||||
|
||||
APP_PATH = File.expand_path('../config/application', __dir__)
|
||||
require_relative '../config/boot'
|
||||
require 'rails/commands'
|
||||
# Absolute path to this script, e.g. /home/user/bin/foo.sh
|
||||
SCRIPT=$(readlink -f "$0")
|
||||
# Absolute path this script is in, thus /home/user/bin
|
||||
SCRIPTPATH=$(dirname "$SCRIPT")
|
||||
|
||||
if [ -e ../.use-docker -a ! -e /etc/app-env ];
|
||||
then
|
||||
$SCRIPTPATH/../script/docker-environment $0 "$@"
|
||||
else
|
||||
$SCRIPTPATH/run-rake "$@"
|
||||
fi
|
||||
|
|
20
bin/rake
20
bin/rake
|
@ -1,7 +1,13 @@
|
|||
#!/usr/bin/env ruby
|
||||
if File.exist?("#{__dir__}/../.use-docker")
|
||||
exec("#{__dir__}/../script/docker-environment", $PROGRAM_NAME, *ARGV) unless File.exist?("/etc/app-env")
|
||||
end
|
||||
require_relative '../config/boot'
|
||||
require 'rake'
|
||||
Rake.application.run
|
||||
#!/bin/sh
|
||||
|
||||
# Absolute path to this script, e.g. /home/user/bin/foo.sh
|
||||
SCRIPT=$(readlink -f "$0")
|
||||
# Absolute path this script is in, thus /home/user/bin
|
||||
SCRIPTPATH=$(dirname "$SCRIPT")
|
||||
|
||||
if [ -e $SCRIPTPATH/../.use-docker -a ! -e /etc/app-env ];
|
||||
then
|
||||
$SCRIPTPATH/../script/docker-environment $0 "$@"
|
||||
else
|
||||
$SCRIPTPATH/run-rake "$@"
|
||||
fi
|
||||
|
|
5
bin/run-rails
Executable file
5
bin/run-rails
Executable file
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
APP_PATH = File.expand_path('../config/application', __dir__)
|
||||
require_relative '../config/boot'
|
||||
require 'rails/commands'
|
5
bin/run-rake
Executable file
5
bin/run-rake
Executable file
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
require_relative '../config/boot'
|
||||
require 'rake'
|
||||
Rake.application.run
|
Loading…
Add table
Add a link
Reference in a new issue