Sharing Projects with OS Commands

Index of All Documentation » Wing Pro Reference Manual » OS Commands Tool »

By default OS Commands are stored in the *.wpr branch of the project file, which in Wing Pro may be checked into a revision control system or otherwise shared with other users and hosts. If the project will be used on different OSes or differently configured systems, some extra work may be needed to configure the same OS Commands to work properly on each host.

Using Environment in Configuration

The best option to manage OS Commands shared across different environments is to use environment variable references in the OS Command's properties. Environment variables used in OS Commands can be defined differently by each user of the project in Project Properties. Because these are stored in the per-user *.wpu branch of the project file (and not the shared *.wpr) the values can differ for each host on which a project is used.

For example, instead of specifying bash -norc for a Command Line style command, the environment variable USERSHELL could be set in the Environment in Project Properties to the user's preferred shell, and then the OS Command could reference that value with ${USERSHELL}.

Environment variables can also be defined for directories used as the Initial Directory, in the Python Path, or for any other value needed for any of the other properties of an OS Command.

In addition to referencing user-defined environment variables, OS Commands may reference any of the special environment variables listed in Environment Variable Expansion.

Storing OS Commands Locally

Another option to keep some OS Commands out of the shared *.wpr branch of the project is to mark them as Shared in their configuration. This causes them to be stored in the User Settings directory and not the project file. Thus they will be omitted from the *.wpr that is commited to revision control.

Storing OS Commands in the Per-User Project File

In Wing Pro, it is also possible to reconfigure a project to cause all the OS Commands in the project to be stored in the user-specific *.wpu branch of the project file. This is done by removing console.toolbox from the proj.shared-attribute-names property in the *.wpr file, as described in more detail in the section "Changing Which Properties are Shared" in Sharing Projects.