Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature #34 #35

Merged
merged 5 commits into from
Feb 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion bash/init-gitpod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,29 @@ if [ ! -d "$GITPOD_REPO_ROOT/bootstrap" ]; then
stop_spinner $err_code
log "SUCCESS: moved Laravel project from ~/temp-app to $GITPOD_REPO_ROOT"
fi
# configure Laravel to use gitpod urls

# BEGIN: parse configurations

# Configure .editorconfig
if [ -e .editorconfig ]; then
ec_type=$(bash bash/utils.sh parse_ini_value starter.ini .editorconfig type)
case $(echo "$ec_type" | tr '[:upper:]' '[:lower:]') in
'laravel-js-2space')
cp bash/snippets/editorconfig/laravel-js-2space .editorconfig
;;
'none')
rm .editorconfig
;;
*)
#Ignore invalid types
;;
esac
fi

# Laravel .env
[ -e .env ] && url=$(gp url 8000); sed -i'' "s#^APP_URL=http://localhost*#APP_URL=$url\nASSET_URL=$url#g" .env
# END: parse configurations

# BEGIN: Optional configurations
# Super user account for phpmyadmin
installed_phpmyadmin=$(. bash/utils.sh parse_ini_value starter.ini phpmyadmin install)
Expand Down
18 changes: 18 additions & 0 deletions bash/snippets/editorconfig/laravel-js-2space
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true

[*.php]
indent_size = 4

[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_size = 2
13 changes: 12 additions & 1 deletion starter.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,24 @@
# starter.ini
# Configuration for gitpod to build your stack as you like it
# Note: Boolean values should always be set to 1 (true) or 0 (false)
# Additional Note: Version numbers for node packages support semantic versioning or can be left blank
# Note: Version numbers for node packages support semantic versioning or can be left blank
# Note: Unless in the comments for a section, configuration is
# used only the first time a workspace is started.
####################

[development]
# Valid values: apache, php
default_server=apache

[.editorconfig]
# valid values are:
# laravel-default: use the .editorconfig that comes with the laravel project scaffolding
# laravel-js-2space: altered vesrion of laravel-default allowing for 2 space indents for most files.
# --> see: bash/snippets/editorconfig/laravel-js-2space
# none: delete .editorconfig. Do not enforce project wide editor settings.
# Note: if left blank or set to an invalid value, laravel-default will be used
type=laravel-js-2space

[phpmyadmin]
# This install happens in .gitpod.Dockerfile so it can get cached one way or the other,
# force a build of the image workspace (see .gitpod.Dockerfile) to get your desired results.
Expand Down