Skip to content

Conversation

nipunbharti21
Copy link

No description provided.

@nipunbharti21
Copy link
Author

Solved #8

@nipunbharti21 nipunbharti21 reopened this Jul 4, 2019
@nipunbharti21
Copy link
Author

I'm saving files in a separate directory(hidden) and then restoring them back to their original path.

@anandundavia
Copy link
Owner

Hahaaha Nice Work 💃


if(ironManWithGauntlet) {
logger.log(`I... am... Iron Man!`);
const correctPaths = JSON.parse(fs.readFileSync(`${os.homedir()}/.to-dust/correct-paths.json`, 'utf8'));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, this will throw en error in case the .to-dust is not already existing.. You might want to first create the directory

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry my bad, I put that checking condition below. I'll move it up.

@nipunbharti21
Copy link
Author

Solved

correctPaths.forEach((filePath) => {
let splitFilePath = filePath.file.split('/');
let filename = splitFilename.join('-');
fs.rename(aFile.file, `${os.homedir()}/.to-dust/${filename}`, (err) => {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tested this? aFile is undefiend here. :/

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, the sequence of argument would be reverse. We would want to move files from .to-dust to its original location

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, actually I was having a test branch where I was doing all this and after the fork, I just copied pasted stuff around which caused these issues.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested it and it works now, do let me know if you find any more issues :)

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.

2 participants