Skip to content

Can i rename project via bash? #89

@neins

Description

@neins

Hello! I use bash script to generate new projects, i clone my template - just a git repository:

function new-gulp() {

    # Copy .git folder of my template to my remote disk
    cp -r ~/WEB/TEMPLATES/HTML\ template\ GULP/.git/ /d/WEB/$1.git

    # Alias 'cd' to my local project dir
    gulpdir

    # Clone to local
    git clone /d/WEB/$1.git
    cd $1

    # Ignore these files
    git update-index --assume-unchanged TEMPLATE.sublime-workspace
    git update-index --assume-unchanged TEMPLATE.sublime-project
    printf '\n*.sublime-*'>>.gitignore

    # Back to remote
    cd  /d/WEB/$1.git
    git init --bare

    # Back to project and initial commit for the project
    gulpdir
    cd $1
    git commit -am "Windows: project added"
    git push

    # Open the project in Sublime Text
    /c/PORTABLE/Sublime\ Text\ 3/sublime_text.exe /c/gulp/gulp-layout/$1 TEMPLATE.sublime-project

    return
    
}

But in this automated chain i have a few "roughness", when sublime text open brand-new TEMPLATE project i have to import and rename project manually, so my question is - can the ProjectManager somehow interact with $1 variable in order to rename project and then automatically add project to sublime? Any ideas to resolve this? I don't know which method ProjectManager uses to rename projects, but long time ago i tried manually rename .sublime-project/.sublime-worspace files and got errors in sublime.

Maybe it will be possible to create a feature like reading external .json file when it appears and name project as it describes in this file?
For example, i just generate ProjectManagerConf.json in root of project folder, which contains:

{
"auto_import": true,
"project_name": "My project"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions