oh-my-batch 0.4.9__tar.gz → 0.5.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: oh-my-batch
3
- Version: 0.4.9
3
+ Version: 0.5.0
4
4
  Summary:
5
5
  License: GPL
6
6
  Author: weihong.xu
@@ -13,13 +13,17 @@ class BatchMaker:
13
13
  self._script_bottom = []
14
14
  self._command = []
15
15
 
16
- def add_work_dirs(self, *dir: str):
16
+ def add_work_dirs(self, *dir: str, abs=False):
17
17
  """
18
18
  Add working directories
19
19
 
20
20
  :param dir: Directories to work on, can be glob patterns
21
+ :param abs: Whether to convert to absolute path
21
22
  """
22
- self._work_dirs.extend(expand_globs(dir))
23
+ paths = expand_globs(dir)
24
+ if abs:
25
+ paths = [os.path.abspath(p) for p in paths]
26
+ self._work_dirs.extend(paths)
23
27
  return self
24
28
 
25
29
  def add_header_files(self, *file: str, encoding='utf-8'):
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "oh-my-batch"
3
- version = "0.4.9"
3
+ version = "0.5.0"
4
4
  description = ""
5
5
  authors = ["weihong.xu <xuweihong.cn@gmail.com>"]
6
6
  license = "GPL"
File without changes
File without changes