Skip to content
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

Added: iron-man-with-gauntlet flag #9

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

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