From 60a3e49da09ae0f2838ad3ddf4faa1e2c8b59500 Mon Sep 17 00:00:00 2001 From: Jon Powers Date: Tue, 3 May 2022 15:59:52 -0400 Subject: [PATCH] start switching to hush --- bin/build | 17 ++-- bin/core_install | 159 +++++++++++++++++------------------ bin/multisite_search_replace | 2 +- bin/pull | 124 +++++++++++++++------------ bin/run | 15 ++-- bin/search_replace | 2 +- bin/setup | 79 ++++++++--------- bin/theme_install | 2 +- bin/vip_import | 2 +- 9 files changed, 212 insertions(+), 190 deletions(-) diff --git a/bin/build b/bin/build index 2358ac0..0caa0d2 100755 --- a/bin/build +++ b/bin/build @@ -1,18 +1,19 @@ -#!/bin/bash +#!/usr/bin/env hush # Install nvm and node -touch /var/www/.bashrc -curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash -source /var/www/.bashrc +{ + touch /var/www/.bashrc; + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash; +} # Install node 14 LTS -nvm install lts/fermium +{ nvm install lts/fermium } # Install global node deps -npm i -g grunt sass +{ npm i -g grunt sass } # Install global python deps -pip3 install tldextract --no-warn-script-location +{ pip3 install tldextract --no-warn-script-location } # Install tools -composer install --working-dir=/app +{ composer install --working-dir=/app } \ No newline at end of file diff --git a/bin/core_install b/bin/core_install index 96015bf..a8fdd9c 100755 --- a/bin/core_install +++ b/bin/core_install @@ -1,95 +1,94 @@ -#!/usr/bin/python3 +#!/usr/bin/env hush -import os +repo = std.env('repo') +multisite = std.env('multisite') -repo = os.environ.get('repo') -multisite = os.environ.get('multisite') or '' +name = std.env('LANDO_APP_NAME') +domain = name ++ '.lndo.site' -name = os.environ.get('LANDO_APP_NAME') -domain = name + '.lndo.site' - -is_multisite = ("yes" in multisite) -is_vip = ("wpcomvip" in repo) +is_multisite = std.contains(multisite, "yes") +is_vip = std.contains(repo, "wpcomvip") # Generate a wp-config file. -def generate_site_config(): - default_config = """ -define( 'WP_DEBUG_LOG', true ); -define( 'WP_DEBUG_DISPLAY', false ); -define( 'WP_ENVIRONMENT_TYPE', 'local' ); -""" - - multisite_config = """ -define( 'WP_ALLOW_MULTISITE', true ); -define( 'MULTISITE', true ); -define( 'SUBDOMAIN_INSTALL', false ); -define( 'PATH_CURRENT_SITE', '/' ); -define( 'SITE_ID_CURRENT_SITE', 1 ); -define( 'BLOG_ID_CURRENT_SITE', 1 ); -""" - - vip_config = """ -/* VIP Go Specific Configuration */ - -if ( file_exists( __DIR__ . '/wp-content/vip-config/vip-config.php' ) ) { - require_once( __DIR__ . '/wp-content/vip-config/vip-config.php' ); -} - -define( 'DISALLOW_FILE_EDIT', true ); -define( 'DISALLOW_FILE_MODS', true ); -define( 'AUTOMATIC_UPDATER_DISABLED', true ); -define( 'JETPACK_DEV_DEBUG', true ); -""" - - config = default_config - command = """wp config create --dbname=wordpress --dbuser=wordpress --dbpass=wordpress --dbhost=database --extra-php <