from __future__ import print_function
import os
import sys
import pkg_resources


def load(plugins=()):
    try:
        version = pkg_resources.get_distribution("virtualfish").version
        commands = ["set -g VIRTUALFISH_VERSION {}".format(version)]
    except pkg_resources.DistributionNotFound:
        commands = []

    base_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
    commands += [
        "set -g VIRTUALFISH_PYTHON_EXEC {}".format(sys.executable),
        "source {}".format(os.path.join(base_path, "virtual.fish")),
    ]

    for plugin in plugins:
        path = os.path.join(base_path, plugin + ".fish")
        if os.path.exists(path):
            commands.append("source {}".format(path))
        else:
            raise ValueError("Plugin does not exist: " + plugin)

    commands.append("emit virtualfish_did_setup_plugins")
    return commands

from __future__ import print_function
import os
import sys
import pkg_resources


def load(plugins=(), full_install=True):
    try:
        version = pkg_resources.get_distribution("virtualfish").version
        commands = ["set -g VIRTUALFISH_VERSION {}".format(version)]
    except pkg_resources.DistributionNotFound:
        commands = []
    base_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

    if full_install:
        commands += [
            "set -g VIRTUALFISH_PYTHON_EXEC {}".format(sys.executable),
            "source {}".format(os.path.join(base_path, "virtual.fish")),
        ]
    else:
        commands = []

    for plugin in plugins:
        path = os.path.join(base_path, plugin + ".fish")
        if os.path.exists(path):
            commands.append("source {}".format(path))
        else:
            raise ValueError("Plugin does not exist: " + plugin)

    if full_install:
        commands.append("emit virtualfish_did_setup_plugins")

    return commands

Add kwarg to load function to distinguish from full install
Add kwarg to load function to distinguish from full install

The load function is used for a full install and thus always adds
general configuration lines to the loader file, but we don't want that
for plugin installation.

  from __future__ import print_function
  import os
  import sys
  import pkg_resources
  
  
- def load(plugins=()):
+ def load(plugins=(), full_install=True):
      try:
          version = pkg_resources.get_distribution("virtualfish").version
          commands = ["set -g VIRTUALFISH_VERSION {}".format(version)]
      except pkg_resources.DistributionNotFound:
          commands = []
+     base_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  
-     base_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
+     if full_install:
-     commands += [
+         commands += [
-         "set -g VIRTUALFISH_PYTHON_EXEC {}".format(sys.executable),
+             "set -g VIRTUALFISH_PYTHON_EXEC {}".format(sys.executable),
-         "source {}".format(os.path.join(base_path, "virtual.fish")),
+             "source {}".format(os.path.join(base_path, "virtual.fish")),
-     ]
+         ]
+     else:
+         commands = []
  
      for plugin in plugins:
          path = os.path.join(base_path, plugin + ".fish")
          if os.path.exists(path):
              commands.append("source {}".format(path))
          else:
              raise ValueError("Plugin does not exist: " + plugin)
  
+     if full_install:
-     commands.append("emit virtualfish_did_setup_plugins")
+         commands.append("emit virtualfish_did_setup_plugins")
+ 
      return commands
  
Add kwarg to load function to distinguish from full install
## Code Before:
from __future__ import print_function
import os
import sys
import pkg_resources


def load(plugins=()):
    try:
        version = pkg_resources.get_distribution("virtualfish").version
        commands = ["set -g VIRTUALFISH_VERSION {}".format(version)]
    except pkg_resources.DistributionNotFound:
        commands = []

    base_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
    commands += [
        "set -g VIRTUALFISH_PYTHON_EXEC {}".format(sys.executable),
        "source {}".format(os.path.join(base_path, "virtual.fish")),
    ]

    for plugin in plugins:
        path = os.path.join(base_path, plugin + ".fish")
        if os.path.exists(path):
            commands.append("source {}".format(path))
        else:
            raise ValueError("Plugin does not exist: " + plugin)

    commands.append("emit virtualfish_did_setup_plugins")
    return commands

## Instruction:
Add kwarg to load function to distinguish from full install
## Code After:
from __future__ import print_function
import os
import sys
import pkg_resources


def load(plugins=(), full_install=True):
    try:
        version = pkg_resources.get_distribution("virtualfish").version
        commands = ["set -g VIRTUALFISH_VERSION {}".format(version)]
    except pkg_resources.DistributionNotFound:
        commands = []
    base_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))

    if full_install:
        commands += [
            "set -g VIRTUALFISH_PYTHON_EXEC {}".format(sys.executable),
            "source {}".format(os.path.join(base_path, "virtual.fish")),
        ]
    else:
        commands = []

    for plugin in plugins:
        path = os.path.join(base_path, plugin + ".fish")
        if os.path.exists(path):
            commands.append("source {}".format(path))
        else:
            raise ValueError("Plugin does not exist: " + plugin)

    if full_install:
        commands.append("emit virtualfish_did_setup_plugins")

    return commands
