Skip to content
This repository was archived by the owner on Aug 9, 2024. It is now read-only.

Local development with Kajabi Products

Kevin Chang edited this page Jul 9, 2020 · 26 revisions

👉 NOTE: this documentation is out of date. Please see the revised walkthrough in the Readme



Use Your Local Sage Gem In Kajabi-Products

This is a non-destructive way to use your currently checked out local Sage branch within your local Kajabi-Products app. It avoids updating Kajabi-Products' gemfile directly which can create extra commits and noisy merge conflicts within gemfile.lock.

How It Works

The function sets a global Bundler config that will use your local Sage gem in place of the Kajabi-Products Gemfile location definition.

Remove the configuration to revert back to the current Sage release.

Install

Depending on your shell (zsh/bash), add this function to your ~/.zshrc or ~/.bashrc:

kajabi-sage-local-gem()
{
  if [ -z "$1" ]; then
    echo "ERROR: Requires the relative path of Sage gem or false to remove."
  else
    if [ "$1" = "false" ]; then
      echo "\nREMOVING: Bundle config Sage local gem definition"
      echo "-------------------------------------------------"
      bundle config --delete disable_local_branch_check
      bundle config --delete local.Sage
    else
      echo "\nSETTING: Bundle config to the Sage gem local location to $1 and using the currently checked out Sage branch."
      echo "-------------------------------------------------"
      bundle config --local disable_local_branch_check true
      bundle config --local local.Sage $1
    fi;
    bundle install
    echo "\n\nBundle Config"
    echo "-------------------------------------------------"
    bundle config
  fi
}

Use Configuration

To set the local location, pass the relative path as an argument.

$ kajabi-sage-local-gem RELATIVE_PATH_TO_LOCAL_SAGE_GEM # ../sage

Kajabi-Products will now use the currently checked out branch of your local Sage gem. 🥳 You can confirm your preferences are active by running bundle config.

$ bundle config

# Settings are listed in order of priority. The top value will be used.
# github.com
# Set for the current user (/Users/~/~/.bundle/config): "XXX:x-oauth-basic"

# disable_local_branch_check
# Set for the current user (/Users/~/~/.bundle/config): true

# local.sage
# Set for the current user (/Users/~/~/.bundle/config): "/Users/~/~/sage"

# gems.contribsys.com
# Set for your local app (/Users/~/~/kajabi-products/.bundle/config): "XXX"

# bootboot_env_prefix
# Set for your local app (/Users/~/~/kajabi-products/.bundle/config): "KAJABI_DEPENDENCIES"

Run Kajabi-Products how you normally would.

Remove Configuration

To unset the configuration:

$ kajabi-sage-local-gem false

Clone this wiki locally