I have an excelfile (Excel 2011, running on OSX 10.9.4) which exports its data into a textfile. I want to automatically upload this textfile to Git once it is exported.
I use the execShell function described in this post: VBA Shell function in Office 2011 for Mac Which gives me nice output for my executed commands.
I want to go to my folder (where my new file was put) and from there call my git commit commands ("git add *", "git commit -m commitmessage" and "git push"). But the problem is i cannot get to my folder. If i try cd /Users/username/folder
and then pwd
i keep getting back "/ " as location (from where i cannot call my git commands)
the complete code for this looks like this:
commitMessage = """New feature file: " & ActiveSheet.Name & """"
gotoPath = Replace(Replace(CurDir(), ":", "/"), "Macintosh HD", "") 'make a "normal" path from CurDir()
result = execShell("cd " & gotoPath, exitCode)
result = execShell("pwd", exitCode)
result = execShell("git add *", exitCode)
result = execShell("git commit -m """ & commitMessage & """", exitCode)
result = execShell("git push", exitCode)
If i execute my git commands from the terminal myself (while in the right folder), the commit works fine. If i execute a "say" command with the execShell function, it works fine as well
Anybody have any suggestions about how to get to the right location? or alternatives to use for this purpose?