Skip to content

Commit 6384ac3

Browse files
committed
Miscellaneous refinement and bug fix
1 parent 551e116 commit 6384ac3

File tree

3 files changed

+265
-185
lines changed

3 files changed

+265
-185
lines changed

aura.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,13 @@ def __init__(self, *args, **kwargs):
196196
super(DestructLightningFromServer, self).__init__(*args, **kwargs)
197197

198198
def run(self, dirs):
199-
if sublime.ok_cancel_dialog("This will Delete the whole folder both from the server and local!" +
200-
" Confirm to continue?"):
199+
_, bundle_name = os.path.split(dirs[0])
200+
if sublime.ok_cancel_dialog("This will Delete %s !" % bundle_name + " Confirm to continue?"):
201201
processor.handle_destructive_files(dirs, ignore_folder=False)
202202

203203
def is_visible(self, dirs):
204-
if len(dirs) == 0: return False
204+
if len(dirs) == 0:
205+
return False
205206
self.settings = context.get_settings()
206207
for _dir in dirs:
207208
attributes = util.get_file_attributes(_dir)
@@ -226,7 +227,7 @@ def run(self, dirs, element=""):
226227
template = templates.get("AuraElement").get(element)
227228
settings = context.get_settings()
228229
templates_path = os.path.join(settings["workspace"],
229-
".templates", template["directory"])
230+
".templates", template["directory"])
230231
with open(templates_path) as fp:
231232
body = fp.read()
232233

@@ -297,15 +298,15 @@ def __init__(self, *args, **kwargs):
297298
def run(self, _type=""):
298299
self._type = _type
299300
self.window.show_input_panel("Please Input %s Name: " % _type,
300-
"", self.on_input, None, None)
301+
"", self.on_input, None, None)
301302

302303
def on_input(self, lightning_name):
303304
# Create component to local according to user input
304305
if not re.match('^[a-zA-Z]+\\w+$', lightning_name):
305306
message = 'Invalid format, do you want to try again?'
306307
if not sublime.ok_cancel_dialog(message): return
307308
self.window.show_input_panel("Please Input %s Name: " % self._type,
308-
"", self.on_input, None, None)
309+
"", self.on_input, None, None)
309310
return
310311

311312
# Get settings
@@ -326,10 +327,10 @@ def on_input(self, lightning_name):
326327
message = "%s is already exist, do you want to try again?" % lightning_name
327328
if not sublime.ok_cancel_dialog(message, "Try Again?"): return
328329
self.window.show_input_panel("Please Input Lightning Name: ",
329-
"", self.on_input, None, None)
330+
"", self.on_input, None, None)
330331
return
331332

332-
lightning_file = os.path.join(component_dir, lightning_name+template["extension"])
333+
lightning_file = os.path.join(component_dir, lightning_name + template["extension"])
333334

334335
# Create Aura lightning file
335336
with open(lightning_file, "w") as fp:

lwc.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ def create_resource(self, js_file_name=None):
158158
".templates", template["directory"])
159159

160160
extension = template["extension"]
161-
element_name = (self.lwc_name if js_file_name is None else self.lwc_name + js_file_name) + extension
161+
element_name = self.lwc_name if js_file_name is None else js_file_name
162+
element_name += extension
162163

163164
# Combine lwc element component name
164165
element_file = os.path.join(self._dir, element_name)

0 commit comments

Comments
 (0)