Batch File Renamer Chrome App Update

Batch File Renamer v0.1
Batch File Renamer v0.1

This post covers the much needed improvements to the batch file renamer app I started earlier.


Contents

Required Apps

Source Control

One of the largest missing pieces to the process of working on this app has been the lack of source control. In searching for how to do git on my Chromebook, I found Chrome Dev Editor which has git support. It is also some sort of IDE for Chrome apps as well. Note: it is a dead project Time will tell how useful this app is - but for now is how I will commit.

So this first section will be me learning how to use that program.

  1. Launch the app
  2. Create a new project, in a new folder
  3. Shut down the app
  4. Copy my files over the boilerplate ones provided
  5. Relaunch the app
  6. Rename old directory
    • This code was being run when I hit the ‘play’ button
  7. I also deleted it from chrome://extensions/

So now I can edit and launch the app, but I’m not sure about debugging it…

It seems the only way to debug is to go back to Chrome’s extensions page, but it will pick up on the instance launched from the dev tools.

Now to commit version 0.1 to github.

  1. Log into github
  2. Create a new repository BatchFileRenamer
  3. Clone back in the Chrome Dev Editor app

And it creates a new project… great

  1. Delete all current projects
  2. Reclone (empty folder)
  3. Now move over all existing files
  4. Restart chrome dev editor
  5. Run the app (verify it works)
  6. Right click the project and Git Add
  7. Right click the project and Commit Changes...
  8. Right click the project and Push to Origin...

And now it exists for the world (as a git repo): https://github.com/jtooker/BatchFileRenamer; all from Chrome OS.

Task List -> Issues

To better manage our task list, I will create them as github issues. Nothing too special here, just busy work.

The general process from now one will be to take an issue, address it and commit it. New issues will be added as needed.

Linting

I have not yet linted my code. I strong recommend JSLint or similar, though I cannot figure out how to use the linter with either the Caret text editor or Chrome Dev Editor.

So it appears I’ll have to occasionally copy and paste my code files into the online linter app. All of that copy/paste is frustratingly inefficient though.

I’ve also switched back to the Caret text editor for actual text editing.

Now that I’m committing my first changes to git, I’d like to see a diff to review, but Chrome Dev Editor seems unable to. You can see it of course after the commit (418f3d2).

Removing Extra ‘.’ When Post Fixing

There is an extra ‘.’ that is added when postfixing. A simple bug to fix.

But I discovered the Chrome Dev Editor has an issue with respect to committing data, so I am unable to continue to commit on my Chromebook at the moment.

It appears I’ll have to enable dev mode; something I was hoping to avoid.

After some time searching for git in dev mode, which only seems available via Chromebrew, I’ve decided to install Linux via Crouton.

Debian Ubuntu Linux with XFCE Desktop Environment

Steps I’m following to set up Linux, specifically Debian with XFCE desktop environment.

  1. Follow Crouton instructions

  2. Run the following command to install:

    sudo sh crouton -r jessie -t xfce

And wait

Then start with sudo startxfce4

And that doesn’t work… graphics drivers. There seems to be work arounds for Ubuntu. Trying:

sudo sh crouton -r trusty -t xfce
[enter user name]
[enter password twice]
sudo startxfce4
[open terminal]
sudo apt-get install software-properties-common python-software-properties
sudo add-apt-repository https://download.01.org/gfx/ubuntu/14.04/main
wget --no-check-certificate https://download.01.org/gfx/RPM-GPG-KEY-ilg -O - | sudo apt-key add -
wget --no-check-certificate https://download.01.org/gfx/RPM-GPG-KEY-ilg-2 -O - | sudo apt-key add -
sudo apt-get update
sudo apt-get upgrade
[back in chrome shell]
sudo sh ~/Downloads/crouton -u -t keyboard,audio,extension -n trusty

Then restarted - seemed to work. I also installed the Extention

After installing git, I was finally able to re-fix and commit issue #13.

Model View

Going forward, the code will get more complicated and require a bit more organization. Thus we need to split our monolithic JS file into at least a model and view.

Going forward, I plan to just leave comments in the defects themselves. So you can see ‘the rest of this blog’ via github starting with issue #14.