There is a directory structure something like given below-
Demo/
└── Project
└── sample.py
I opened Project/ directory in the VS Code but the path shown in the terminal is from its root directory i.e., shubhanshusingh#shubhanshusingh:~/Demo/Project$ that I don't want.
I want it to be like this shubhanshusingh#shubhanshusingh:~/Project$, that is, show only the name of the last directory. Is there any configuration that I can set for the VS Code terminal? Please let me know.
I am using WSL:Ubuntu
Related
I'm trying to create .app package that contains jdk, jar and shell script, basically I'm trying to run jar inside .app.
My contents inside .app looks like this (app has same name as unix executable):
.
├── MacOS
│ └── AppName
├── app
│ └── myapp.jar
└── jdk
AppName, if we give it .sh extension and look into it, looks like this
#!/bin/zsh
../jdk/bin/java -jar ../app/myapp.jar
If I run this file executable file from terminal with ./AppName it works without any problems. But if I just double click it, it doesn't work saying no such file or directory: ../jdk/bin/java.
I believe it should work with double clicking in order to work with .app, because other .app-s work like this.
Relative path names like ../jdk/bin/java are relative to the current working directory, not to the location of the script.
You can reproduce the problem in the terminal when your working directory is not MacOS but, e.g., the parent directory, and you start the application as MacOS/AppName.
A possible solution might be
#!/bin/zsh
SCRIPTDIR=$(dirname $0)
"$SCRIPTDIR"/../jdk/bin/java -jar "$SCRIPTDIR"/../app/myapp.jar
I'm using this guide to build a small Go app:
https://codegangsta.gitbooks.io/building-web-apps-with-go/index.html
Folder structure looks like this:
go/src/fileserver/
main.go
fileserver.exe
public/
index.html
css/
bootstrap.min.css
The deployment instructions mention a "procfile" and a ".godir" file but it's a bit unclear what these are supposed to contain or where they are to be implemented. I'm not quite sure if my folder structure is correct either.
The error I'm getting is:
Failed to detect set buildpack https://github.com/kr/heroku-buildpack-go.git
Am going to be quoting the heroku documentation a lot.
Procfile
Define a Procfile
Use a Procfile, a text file in the root directory of your application, to explicitly declare what command should be executed to start your app.
The Procfile in the example app you deployed looks like this:
web: go-getting-started
This declares a single process type, web, and the command needed to run it. The name web is important here. It declares that this process type will be attached to the HTTP routing stack of Heroku, and receive web traffic when deployed. The command used here, go-getting-started is the compiled binary of the getting started app.
Procfiles can contain additional process types. For example, you might declare one for a background worker process that processes items off of a queue.
Define a Procfile
So in your example you would have a file named 'Procfile' in your root directory with contents being:
web: fileserver
.godir
The .godir file is simply a file that simply specifies the root directory of your go project. This is useful when you say have a number of modules for a web app in different languages. So for example given a repo with the following tree.
github.com
└──someuser
└── somerepo
├── .godir
├── go_module
└── node_module
Where the contents of your .godir file would be:
github.com/someuser/somerepo/go_module
A more verbose explanation of what .godir is for and when it is used can be found here.
I have several private repo,such as A,B,C,D and the remote git url is https://127.0.0.1/repo/repo.git . How can i push A,B,C,D to the same remote git url(https://127.0.0.1/repo/repo.git) ? then local git just like .cocoapods/repos/master/Specs content, such as
├── Specs
└── A
└── B
└── C
└── D
if it done , how can i make the profile for installing.
Just add the pod-spec file of your cocoa-pod to the main repo folder and update the pod-spec source files path.
More details:
to create a cocoa-pod you need two steps
pod lib create POD_NAME
///this command runs in terminal to create for you a library with example option and many other things
pod lib lint POD_NAME.podspec
/// validate your spec file, check syntax and your files.
You could skip the first command and create your pod-spec file manually || copy it from any repo
then update it, add your code to your cocoa-pod folder, set the git repo in your pod-spec
make sure the git-repo have the pod-spec file in the main directory
You will find a complete example with Demo application in this project
https://github.com/abuzeid-ibrahim/DevPods
I am creating a project in go. Since there is already a lot of things at the root of the repository of the project (doc, README.md...), I want all the source code to go in a folder src, and all the test code in a folder named test :
\go
\src
\github.com
\user
\my_project
\src
main.go
some_func.go
\test
test_main.go
test_some_func.go
\doc
README.md
But I have two issues :
The build command is not working while I am in the my_project folder. I have to go in the my_project/src to successfully run build. I want to do it from the my_project folder. How to inforce go to understand that the source for my_project is in the src code ?
Then the executable produced by the go install command is named src. How to change the name of that executable ?
I want all the source code to go in a folder src, and all the test code in a folder named test :
Go has a way that it organizes source code. Do not fight this. It is how the system works. Organize your code the way Go wants you to. Do not try to force Go to work the way you have learned working in some other language. Every language has its own ways of doing things. None of them are "correct." Like Java, Go has very specific ideas of what you're supposed to do. Do it that way. (This isn't an argument about whether Go is "right" or Go is "wrong." Go is Go, and it does things in the Go way.)
In particular, you should not create another "src" directory. There is already a "src" directory at the top of the "go" tree. If you create another, redundant, "src" directory, then the package name for your project is "github.com/user/my_project/src" which is likely not what you want.
To make the executable be named what you want, put it in a directory named what you want (probably "my_project"). Put test files with the files they test. This is how go works.
So your tree should look like:
\go
\src
\github.com
\user
\my_project
main.go
some_func.go
main_test.go
some_func_test.go
\doc
README.md
Attempts to do something other than this is going to blow up over and over again, and questions of "how do I make the build system do this other thing" will continually return "put your code in the way the build system expects."
For details on what Go expects, and how you should organize your code, see GOPATH environment variable in the Command Go documentation. Once you've built your system this way for a while, you will start to see where you can deviate from it (like creating other directories for test utilities, but not test cases). Don't start deviating until you've tried it the standard Go way.
I'm trying to build a pre-existing HaxePunk project in sublime (switching away from FlashDevelop).
problem: Error: Could not process argument
Here's my .hxml file:
-neko
-cp "c:/path/to/project/src"
-main Main
I've read somewhere that you shouldn't use the /src convention for your src files. That's annoying, since I want assets and binaries in their own directories separate from src files. How do I properly configure this?
You really should use the the src convention and not stuff everything within the same directory. You also don't want to make the build specific to your machine, so in you example above you don't want an absolute path but a relative one. So try the following:
#content of c:/path/to/project/build.hxml
-neko bin/output.n
-cp src
-main Main
Note that for -cp you use the relative path. The path is relative to where haxe is executed. That usually coincides with where your build.hxml file is, but it is not mandatory.
Also, you didn't specify an output file for neko. Note that you will have to create the directory bin by hand because the compiler will not do that for you and will complain if it doesn't exist.
These information are general and in no way tied with Sublime. Sublime should play just nice with these settings.