We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 366ab20 commit 0c70163Copy full SHA for 0c70163
filter_plugins/shell_config.py
@@ -0,0 +1,37 @@
1
+"""
2
+各シェルの設定ファイルを返す。
3
+/bin/bashなら ['bash', '.bashrc', '.bash_profile']、など。
4
5
+
6
+from __future__ import (absolute_import, division, print_function)
7
+__metaclass__ = type
8
9
10
+def get_shell_config(shell_path):
11
+ shell_name = shell_path.split('/')[-1]
12
+ if shell_name == 'bash':
13
+ return {
14
+ 'name': 'bash',
15
+ 'rc_file': '.bashrc',
16
+ 'profile_path': '.bash_profile'
17
+ }
18
+ elif shell_name == 'zsh':
19
20
+ 'name': 'zsh',
21
+ 'rc_file': '.zshrc',
22
+ 'profile_path': '.zprofile'
23
24
+ # 他のシェルに対する設定をここに追加
25
+ else:
26
27
+ 'name': shell_name,
28
+ 'rc_file': None,
29
+ 'profile_path': None
30
31
32
33
+class FilterModule(object):
34
+ def filters(self):
35
36
+ 'shell_config': get_shell_config
37
0 commit comments