Skip to content

Remove file extension only when present#13

Open
matthewfranglen wants to merge 1 commit into
bhurlow:masterfrom
matthewfranglen:patch-1
Open

Remove file extension only when present#13
matthewfranglen wants to merge 1 commit into
bhurlow:masterfrom
matthewfranglen:patch-1

Conversation

@matthewfranglen

@matthewfranglen matthewfranglen commented Oct 19, 2016

Copy link
Copy Markdown
Contributor

If you name the machine to import without providing the extension then the old code will snip 4 characters off the end of the machine name.

Since the .zip extension is added to the name later it would be fine to just pass the machine name, if the behaviour was changed to only remove the extension when it exists. The regular expression used for removal matches the behaviour of the import.sh script (specifically "${filename%.*}").

If you name the machine to import without providing the extension then the old code will snip 4 characters off the end of the machine name.

Since the `.zip` extension is added to the name later it would be fine to just pass the machine name, if the behaviour was changed to only remove the extension when it exists. The regular expression used for removal matches the behaviour of the import.sh script (specifically `"${filename%.*}"`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant