-
-
Notifications
You must be signed in to change notification settings - Fork 412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add execute commands for removing files #1095
Conversation
} | ||
throw e; | ||
} finally { | ||
service.close(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
`Will get the data from '${dstPath}'`); | ||
pathOnServer = dstPath; | ||
} else { | ||
const simRoot = device.getDir(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this may potentially damage Simulator FS. Should we rather limit absolute paths, to only known subfolders?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that it's much of a problem. If people mess things up, oh well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, only full reset will restore the Simulator in such case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree w/ @mykola-mokhnach but otherwise +1
lib/commands/file-movement.js
Outdated
async function deleteFromSimulator (device, remotePath) { | ||
let pathOnServer; | ||
if (CONTAINER_PATH_PATTERN.test(remotePath)) { | ||
const { bundleId, pathInContainer: dstPath } = await parseContainerPath(remotePath, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: we usually don't have spaces around braces except in imports, i thought.
3cf77d0
to
50407b8
Compare
lib/commands/file-movement.js
Outdated
const {bundleId, pathInContainer: dstPath} = await parseContainerPath(remotePath, | ||
async (appBundle, containerType) => await getAppContainer(device.udid, appBundle, null, containerType)); | ||
log.info(`Parsed bundle identifier '${bundleId}' from '${remotePath}'. ` + | ||
`Will get the data from '${dstPath}'`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this info message needs some update
* feat: add execute commands for removing files * fix: address review * fix: adjust logging
Adds functions (
mobile: deleteFile
andmobile: deleteFolder
) to remove files/folders from the device or simulator.Locally this has been tested with an iPhone 7 Plus running iOS 13.1 with