Skip to content

Commit

Permalink
custom shell setting unimplemented, not viable
Browse files Browse the repository at this point in the history
  • Loading branch information
mxdevmanuel committed Mar 9, 2017
1 parent 6465feb commit 38c4d44
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 18 deletions.
2 changes: 0 additions & 2 deletions DjangoCommands.sublime-settings
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
"linux_terminal": "x-terminal-emulator",
// Mac OSX only: define your preferred_terminal_emulator
"osx_terminal": "Terminal",
// Shell
"shell_executable": "bash",
// Per project setting "python_interpreter" overrides "python_bin"
"project_override": true,
// Open browser pointint to root url after runserver command
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,8 @@ Currently supports following commands:
* `server_port`: port for the server to listen
* `linux_terminal`: Linux only, used to define a custom command line emulator\*\*
* `osx_terminal`: Mac OSX only, used to define a custom terminal emulator.\*\*\*
* `shell_executable`: For OSX and Linux, set your preferred shell for the commands to be launched in.
* `browser_after_runserver`: set true to open a browser pointing to the root url after a run server command.
* `project_override`: (Boolean) Per project setting "python_interpreter" overrides "python_bin"

* `server_custom_command`: Per project setting to specify a custom server to run

***
Expand All @@ -132,7 +130,7 @@ Currently supports following commands:

\*\*Default is `x-terminal-emulator` with a fallback to `xterm`

\*\*\*Default is "Terminal"
\*\*\*Default is `Terminal`

### Please report any issue, bug, enhacement or comment [here](https://github.com/vladimirnani/DjangoCommands/issues)
### We'll be glad to read and work on all of them
Expand Down
11 changes: 1 addition & 10 deletions django-commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,6 @@ def get_version(self, extb=None):
version = re.match(r'(\d\.\d+)', output.decode('utf-8')).group(0)
return version

def get_shell(self):
shell = self.settings.get('shell_executable', 'bash')
if not os.access(shell, os.X_OK):
self.error_msg = "{} not found. Bash will be used as a fallback".format(shell)
self.display_error_message()
shell = 'bash'
return shell

def find_manage_py(self):
django_project_root = \
sublime.active_window().active_view().settings().get('django_project_root') \
Expand Down Expand Up @@ -433,8 +425,7 @@ def run(self):
if PLATFORM == 'Windows':
command = ['cmd', '/k', '{}'.format(os.path.join(bin_dir, self.command))]
if PLATFORM == 'Linux' or PLATFORM == 'Darwin':
command = [self.get_shell(),
"--rcfile", "<(echo '. ~/.bashrc && . {}')".format(os.path.join(bin_dir, self.command))]
command = ["bash", "--rcfile", "<(echo '. ~/.bashrc && . {}')".format(os.path.join(bin_dir, self.command))]
thread = CommandThread(command, notsplit=True)
thread.start()

Expand Down
6 changes: 3 additions & 3 deletions messages/important.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Django manage commands 1.7.9

- Mac OSX users now can select their preferred terminal emulator to be triggered to run the corresponding command. Use `osx_terminal` setting.

- Linux and Mac OSX now can define their preferred shell to run commands in. E.g: Bash, Zsh, Fish, etc. It will be checked that the shell executable exists and its accesible and, if not, will fallback to bash.

- Windows users, would you like to be able to select another terminal instead of cmd.exe like mintty, cmder or git-bash? If so please open an Issue(only one please so others can comment on it, and keep the issue tracker organized) at our github repo and let us know.

- Minor fixes and performance optimizations.
- Windows slight performance optimization.

- Minor fixes.

0 comments on commit 38c4d44

Please sign in to comment.